@smbcloud / cli / commits / 9c42190

format

Seto Elkahfi committed Sep 3, 2023 at 17:56 UTC 9c4219034b97588b8997c2cefe04041eeeed18b3
2 files changed +13 -11
smbpndk-cli/src/account/login/process.rs
+12 -10
@@ -72,7 +72,9 @@ async fn process_authorization(auth: SmbAuthorization) -> Result<CommandResult>
72 if let Some(error_code) = auth.error_code {
73 debug!("{}", error_code);
74 match error_code {
75 - ErrorCode::EmailNotFound => return create_new_account(auth.user_email, auth.user_info).await,
75 + ErrorCode::EmailNotFound => {
76 + return create_new_account(auth.user_email, auth.user_info).await
77 + }
78 ErrorCode::EmailUnverified => return send_email_verification(auth.user).await,
79 }
80 }
@@ -138,7 +140,6 @@ async fn create_new_account(
140 async fn send_email_verification(user: Option<User>) -> Result<CommandResult> {
141 // Return early if user is null
142 if let Some(user) = user {
141 -
143 let confirm = Confirm::with_theme(&ColorfulTheme::default())
144 .with_prompt("Do you want to send a new verification email?")
145 .interact()
@@ -166,7 +167,10 @@ async fn send_email_verification(user: Option<User>) -> Result<CommandResult> {
167 async fn resend_email_verification(user: User) -> Result<CommandResult> {
168 let spinner = Spinner::new(
169 spinners::Spinners::SimpleDotsScrolling,
169 - style("Sending verification email...").green().bold().to_string(),
170 + style("Sending verification email...")
171 + .green()
172 + .bold()
173 + .to_string(),
174 );
175
176 let response = Client::new()
@@ -178,13 +182,11 @@ async fn resend_email_verification(user: User) -> Result<CommandResult> {
182 .await?;
183
184 match response.status() {
181 - reqwest::StatusCode::OK => {
182 - Ok(CommandResult {
183 - spinner,
184 - symbol: "✅".to_owned(),
185 - msg: "Verification email sent!".to_owned(),
186 - })
187 - }
185 + reqwest::StatusCode::OK => Ok(CommandResult {
186 + spinner,
187 + symbol: "✅".to_owned(),
188 + msg: "Verification email sent!".to_owned(),
189 + }),
190 _ => {
191 let error = anyhow!("Failed to send verification email.");
192 Err(error)
smbpndk-cli/src/account/model/mod.rs
+1 -1
@@ -1,4 +1,4 @@
1 -use std::fmt::{Formatter, Display};
1 +use std::fmt::{Display, Formatter};
2
3 use serde::{Deserialize, Serialize};
4