From: Corey Farwell Date: Sun, 24 Jun 2018 14:16:11 +0000 (-0400) Subject: Utilize `if let` construct instead of explicit unwrapping. X-Git-Tag: tor-0.3.5.1-alpha~214^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=94880b2db73d514e0352d70be8eda2b36132aa4d;p=thirdparty%2Ftor.git Utilize `if let` construct instead of explicit unwrapping. --- diff --git a/src/rust/protover/ffi.rs b/src/rust/protover/ffi.rs index 0470cd487a..f668dba80b 100644 --- a/src/rust/protover/ffi.rs +++ b/src/rust/protover/ffi.rs @@ -61,10 +61,8 @@ pub extern "C" fn protover_all_supported( Ok(n) => n, Err(_) => return 1, }; - let maybe_unsupported: Option = relay_proto_entry.all_supported(); - if maybe_unsupported.is_some() { - let unsupported: UnvalidatedProtoEntry = maybe_unsupported.unwrap(); + if let Some(unsupported) = relay_proto_entry.all_supported() { let c_unsupported: CString = match CString::new(unsupported.to_string()) { Ok(n) => n, Err(_) => return 1,