Utilize if let construct instead of explicit unwrapping.

This commit is contained in:
Corey Farwell 2018-06-24 10:16:11 -04:00
parent 7e9c37f9cb
commit 94880b2db7

View File

@ -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,