aboutsummaryrefslogtreecommitdiff
path: root/src/rust
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2018-06-24 10:16:11 -0400
committerCorey Farwell <coreyf@rwell.org>2018-06-24 10:16:11 -0400
commit94880b2db73d514e0352d70be8eda2b36132aa4d (patch)
tree77ca668bfbe2d845b5d85fe3375f8fa415cea386 /src/rust
parent7e9c37f9cb33d937a664dec83ee28da447a41aa6 (diff)
downloadtor-94880b2db73d514e0352d70be8eda2b36132aa4d.tar.gz
tor-94880b2db73d514e0352d70be8eda2b36132aa4d.zip
Utilize `if let` construct instead of explicit unwrapping.
Diffstat (limited to 'src/rust')
-rw-r--r--src/rust/protover/ffi.rs4
1 files changed, 1 insertions, 3 deletions
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<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,