Skip to content

Commit 8774339

Browse files
odelcroimcalinghee
authored andcommitted
refactor on_conflict check
1 parent 005f6c7 commit 8774339

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/config/src/sections/upstream_oauth2.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,14 @@ impl ConfigurationSection for UpstreamOAuth2Config {
112112
}
113113

114114
if provider.claims_imports.localpart.on_conflict.is_some()
115-
&& provider.claims_imports.localpart.on_conflict.unwrap().add()
115+
&& !provider.claims_imports.localpart.on_conflict.unwrap().is_fail()
116116
&& !matches!(
117117
provider.claims_imports.localpart.action,
118118
ImportAction::Force | ImportAction::Require
119119
)
120120
{
121121
return annotate(figment::Error::custom(
122-
"When `on_conflict` is set to `add`, localpart claim import must be either `force` or `require`",
122+
"When `on_conflict` is used to resolved conflicts, `localpart` claim import must be either `force` or `require`",
123123
));
124124
}
125125

@@ -212,8 +212,8 @@ pub enum OnConflict {
212212
}
213213

214214
impl OnConflict {
215-
const fn add(&self) -> bool {
216-
matches!(self, OnConflict::Add)
215+
const fn is_fail(&self) -> bool {
216+
matches!(self, OnConflict::Fail)
217217
}
218218
}
219219

0 commit comments

Comments
 (0)