Skip to content

Commit c17b5c1

Browse files
committed
server: fix clippy::manual_unwrap_or_default finding
``` warning: match can be simplified with `.unwrap_or_default()` --> src/server.rs:486:13 | 486 | / match client_hello.server_name() { 487 | | Some(c) => c, 488 | | None => "", 489 | | } | |_____________^ help: replace it with: `client_hello.server_name().unwrap_or_default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default = note: `#[warn(clippy::manual_unwrap_or_default)]` on by default ```
1 parent 47d7b0f commit c17b5c1

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/server.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -482,12 +482,7 @@ impl ClientHelloResolver {
482482

483483
impl ResolvesServerCert for ClientHelloResolver {
484484
fn resolve(&self, client_hello: ClientHello) -> Option<Arc<CertifiedKey>> {
485-
let server_name: &str = {
486-
match client_hello.server_name() {
487-
Some(c) => c,
488-
None => "",
489-
}
490-
};
485+
let server_name = client_hello.server_name().unwrap_or_default();
491486
let server_name: rustls_str = match server_name.try_into() {
492487
Ok(r) => r,
493488
Err(_) => return None,

0 commit comments

Comments
 (0)