From 7cb70a973ca2c610bad32da79988c66e1e9fbd62 Mon Sep 17 00:00:00 2001 From: moznion Date: Sat, 12 Dec 2020 00:26:58 +0900 Subject: [PATCH] Fix a clippy warning --- code-generator/src/main.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/code-generator/src/main.rs b/code-generator/src/main.rs index fdd9a30..25e3a69 100644 --- a/code-generator/src/main.rs +++ b/code-generator/src/main.rs @@ -925,18 +925,11 @@ fn parse_dict_file(dict_file_path: &Path) -> Result { } Err(_) => { // XXX ad-hoc - let cap = fixed_length_octets_re.captures(items[3]); - if cap.is_some() { + let maybe_cap = fixed_length_octets_re.captures(items[3]); + if let Some(cap) = maybe_cap { ( RadiusAttributeValueType::Octets, - Some( - cap.unwrap() - .get(1) - .unwrap() - .as_str() - .parse::() - .unwrap(), - ), + Some(cap.get(1).unwrap().as_str().parse::().unwrap()), ) } else { return Err(format!("invalid type has come => {}", items[3]));