mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-01 08:03:31 +01:00
Utilize if let
construct instead of explicit unwrapping.
This commit is contained in:
parent
7e9c37f9cb
commit
94880b2db7
@ -61,10 +61,8 @@ pub extern "C" fn protover_all_supported(
|
||||
Ok(n) => n,
|
||||
Err(_) => return 1,
|
||||
};
|
||||
let maybe_unsupported: Option<UnvalidatedProtoEntry> = 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,
|
||||
|
Loading…
Reference in New Issue
Block a user