Skip to content

Commit 7fda5de

Browse files
committed
clippy fixes.
1 parent df3cd69 commit 7fda5de

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/config.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@ impl Config {
5757
let secrets =
5858
SecretStore::open("oauth_secrets").expect("Could not open oauth_secrets secret store");
5959

60-
let get_secret = |key: &str| match secrets.get(key) {
61-
Some(secret) => Some(
60+
let get_secret = |key: &str| {
61+
secrets.get(key).map(|secret| {
6262
std::str::from_utf8(&secret.plaintext())
6363
.unwrap()
64-
.to_string(),
65-
),
66-
_ => None,
64+
.to_string()
65+
})
6766
};
6867

69-
let require_secret =
70-
|key: &str| get_secret(key).expect(&format!("Required secret {} not found", key));
68+
let require_secret = |key: &str| {
69+
get_secret(key).unwrap_or_else(|| panic!("Required secret {} not found", key))
70+
};
7171

7272
let cfg = ConfigStore::open("oauth_config");
7373
let jwks = cfg.get("jwks").expect("JWKS metadata not found");

0 commit comments

Comments
 (0)