Skip to content

Commit 7544c61

Browse files
committed
crypto_provider: fix clippy::question_mark finding
``` error: this `match` expression can be replaced with `?` --> src/crypto_provider.rs:466:20 | 466 | let provider = match provider_from_crate_features() { | ____________________^ 467 | | Some(provider) => provider, 468 | | None => return None, 469 | | }; | |_____^ help: try instead: `provider_from_crate_features()?` ```
1 parent a233b51 commit 7544c61

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/crypto_provider.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,14 +461,9 @@ pub(crate) fn get_default_or_install_from_crate_features() -> Option<Arc<CryptoP
461461
return Some(provider.clone());
462462
}
463463

464-
let provider = match provider_from_crate_features() {
465-
Some(provider) => provider,
466-
None => return None,
467-
};
468-
469464
// Ignore the error resulting from us losing a race to install the default,
470465
// and accept the outcome.
471-
let _ = provider.install_default();
466+
let _ = provider_from_crate_features()?.install_default();
472467

473468
// Safety: we can unwrap safely here knowing we've just set the default, or
474469
// lost a race to something else setting the default.

0 commit comments

Comments
 (0)