From 4d8a91418f935b43f64f972e95b0e8a39721ad42 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Tue, 6 Oct 2020 12:27:45 +0200 Subject: [PATCH] clippy: fix unnecessary_unwrap Signed-off-by: ljedrz --- compiler/src/expression/tuple/tuple.rs | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/compiler/src/expression/tuple/tuple.rs b/compiler/src/expression/tuple/tuple.rs index caed61a360..8d397ff2f5 100644 --- a/compiler/src/expression/tuple/tuple.rs +++ b/compiler/src/expression/tuple/tuple.rs @@ -38,19 +38,18 @@ impl> ConstrainedProgram { // Check explicit tuple type dimension if given let mut expected_types = vec![]; - if expected_type.is_some() { - match expected_type.unwrap() { - Type::Tuple(ref types) => { - expected_types = types.clone(); - } - ref type_ => { - return Err(ExpressionError::unexpected_tuple( - type_.to_string(), - format!("{:?}", tuple), - span, - )); - } + match expected_type { + Some(Type::Tuple(ref types)) => { + expected_types = types.clone(); } + Some(ref type_) => { + return Err(ExpressionError::unexpected_tuple( + type_.to_string(), + format!("{:?}", tuple), + span, + )); + } + None => {} } let mut result = vec![];