mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-14 07:03:44 +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,
|
Ok(n) => n,
|
||||||
Err(_) => return 1,
|
Err(_) => return 1,
|
||||||
};
|
};
|
||||||
let maybe_unsupported: Option<UnvalidatedProtoEntry> = relay_proto_entry.all_supported();
|
|
||||||
|
|
||||||
if maybe_unsupported.is_some() {
|
if let Some(unsupported) = relay_proto_entry.all_supported() {
|
||||||
let unsupported: UnvalidatedProtoEntry = maybe_unsupported.unwrap();
|
|
||||||
let c_unsupported: CString = match CString::new(unsupported.to_string()) {
|
let c_unsupported: CString = match CString::new(unsupported.to_string()) {
|
||||||
Ok(n) => n,
|
Ok(n) => n,
|
||||||
Err(_) => return 1,
|
Err(_) => return 1,
|
||||||
|
Loading…
Reference in New Issue
Block a user