diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2022-03-07 21:58:49 +0000 |
---|---|---|
committer | Sven-Hendrik Haase <svenstaro@gmail.com> | 2022-03-07 21:58:49 +0000 |
commit | a2ebc13d491c59beb694d0df8d37454e4ab18129 (patch) | |
tree | e9ea00fd7835dc0745125c41ba1f9150e4cb0035 /src | |
parent | Bump deps (diff) | |
download | miniserve-a2ebc13d491c59beb694d0df8d37454e4ab18129.tar.gz miniserve-a2ebc13d491c59beb694d0df8d37454e4ab18129.zip |
Fix lints
Diffstat (limited to 'src')
-rw-r--r-- | src/config.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/config.rs b/src/config.rs index 73fcec2..f140c2a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -167,12 +167,11 @@ impl MiniserveConfig { let key = pemfile::read_all(key_file) .context("Reading private key file")? .into_iter() - .filter_map(|item| match item { + .find_map(|item| match item { pemfile::Item::RSAKey(key) | pemfile::Item::PKCS8Key(key) => Some(key), _ => None, }) - .next() - .ok_or(anyhow!("No supported private key in file"))?; + .ok_or_else(|| anyhow!("No supported private key in file"))?; let server_config = rustls::ServerConfig::builder() .with_safe_defaults() .with_no_client_auth() |