Skip to content

Commit

Permalink
crypto_provider: fix clippy::question_mark finding
Browse files Browse the repository at this point in the history
```
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()?`
```
  • Loading branch information
cpu committed Nov 18, 2024
1 parent 3cd9f98 commit dbc182a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/crypto_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,14 +463,9 @@ pub(crate) fn get_default_or_install_from_crate_features() -> Option<Arc<CryptoP
return Some(provider.clone());
}

let provider = match provider_from_crate_features() {
Some(provider) => provider,
None => return None,
};

// Ignore the error resulting from us losing a race to install the default,
// and accept the outcome.
let _ = provider.install_default();
let _ = provider_from_crate_features()?.install_default();

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

0 comments on commit dbc182a

Please sign in to comment.