From 79fabc6bcca34cd1c14d8a4ffc7f85ffdf1c443d Mon Sep 17 00:00:00 2001 From: liyunjia Date: Fri, 1 Nov 2024 09:16:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/src/entities/account.rs | 56 +++++++++++++++++----------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/domain/src/entities/account.rs b/domain/src/entities/account.rs index 1a220bd..e03f149 100644 --- a/domain/src/entities/account.rs +++ b/domain/src/entities/account.rs @@ -95,14 +95,14 @@ impl Account { .await { Ok(account) => { - return Ok(Some(account)); + Ok(Some(account)) } Err(Error::RowNotFound) => { - return Ok(None); + Ok(None) } Err(e) => { tracing::error!("find_by_apple_id error: {:?}", e); - return Err(e); + Err(e) } } } @@ -116,18 +116,18 @@ impl Account { r#"select * from account where custom_id = $1"#, custom_id ) - .fetch_one(db_pool) - .await + .fetch_one(db_pool) + .await { Ok(account) => { - return Ok(Some(account)); + Ok(Some(account)) } Err(Error::RowNotFound) => { - return Ok(None); + Ok(None) } Err(e) => { tracing::error!("find_by_custom_id error: {:?}", e); - return Err(e); + Err(e) } } } @@ -141,18 +141,18 @@ impl Account { r#"select * from account where facebook_id = $1"#, facebook_id ) - .fetch_one(db_pool) - .await + .fetch_one(db_pool) + .await { Ok(account) => { - return Ok(Some(account)); + Ok(Some(account)) } Err(Error::RowNotFound) => { - return Ok(None); + Ok(None) } Err(e) => { tracing::error!("find_by_facebook_id error: {:?}", e); - return Err(e); + Err(e) } } } @@ -166,18 +166,18 @@ impl Account { r#"select * from account where google_id = $1"#, google_id ) - .fetch_one(db_pool) - .await + .fetch_one(db_pool) + .await { Ok(account) => { - return Ok(Some(account)); + Ok(Some(account)) } Err(Error::RowNotFound) => { - return Ok(None); + Ok(None) } Err(e) => { tracing::error!("find_by_google_id error: {:?}", e); - return Err(e); + Err(e) } } } @@ -217,18 +217,18 @@ impl Account { username, password.as_bytes().to_vec(), ) - .fetch_one(db_pool) - .await + .fetch_one(db_pool) + .await { Ok(account) => { - return Ok(Some(account)); + Ok(Some(account)) } Err(Error::RowNotFound) => { - return Ok(None); + Ok(None) } Err(e) => { tracing::error!("find_by_google_id error: {:?}", e); - return Err(e); + Err(e) } } } @@ -252,18 +252,18 @@ impl Account { self.wallet, self.metadata ) - .fetch_one(&mut **transaction) - .await + .fetch_one(&mut **transaction) + .await { Ok(account) => { - return Ok(Some(account)); + Ok(Some(account)) } Err(Error::RowNotFound) => { - return Ok(None); + Ok(None) } Err(e) => { tracing::error!("add_account error: {:?}", e); - return Err(e); + Err(e) } } }