Skip to content

Commit 82fc32c

Browse files
committed
feat!: [#591] rename enum variant EmailOnSignup::None to Ignored
1 parent bb75303 commit 82fc32c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/config/v1/auth.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub enum EmailOnSignup {
5858
/// The email is optional on signup.
5959
Optional,
6060
/// The email is not allowed on signup. It will only be ignored if provided.
61-
None, // code-review: rename to `Ignored`?
61+
Ignored,
6262
}
6363

6464
impl Default for EmailOnSignup {
@@ -72,7 +72,7 @@ impl fmt::Display for EmailOnSignup {
7272
let display_str = match self {
7373
EmailOnSignup::Required => "required",
7474
EmailOnSignup::Optional => "optional",
75-
EmailOnSignup::None => "none",
75+
EmailOnSignup::Ignored => "ignored",
7676
};
7777
write!(f, "{display_str}")
7878
}
@@ -85,8 +85,10 @@ impl FromStr for EmailOnSignup {
8585
match s.to_lowercase().as_str() {
8686
"required" => Ok(EmailOnSignup::Required),
8787
"optional" => Ok(EmailOnSignup::Optional),
88-
"none" => Ok(EmailOnSignup::None),
89-
_ => Err(format!("Unknown config 'email_on_signup' option (required, optional, none): {s}")),
88+
"none" => Ok(EmailOnSignup::Ignored),
89+
_ => Err(format!(
90+
"Unknown config 'email_on_signup' option (required, optional, ignored): {s}"
91+
)),
9092
}
9193
}
9294
}

src/services/user.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl RegistrationService {
8686
}
8787
registration_form.email.clone()
8888
}
89-
EmailOnSignup::None => None,
89+
EmailOnSignup::Ignored => None,
9090
EmailOnSignup::Optional => registration_form.email.clone(),
9191
};
9292

0 commit comments

Comments
 (0)