]> git.lizzy.rs Git - rust.git/commitdiff
simplify if let Some(_) = x to if x.is_some() (clippy::redundant_pattern_matching)
authorMatthias Krüger <matthias.krueger@famsik.de>
Sat, 5 Dec 2020 12:35:05 +0000 (13:35 +0100)
committerMatthias Krüger <matthias.krueger@famsik.de>
Tue, 8 Dec 2020 19:27:49 +0000 (20:27 +0100)
compiler/rustc_infer/src/infer/error_reporting/nice_region_error/different_lifetimes.rs

index 59786059fae675d6001101bfc036b8ff8b3e999a..cdd68d83f22b14fb2a2eacb57ed5886cef6daade 100644 (file)
@@ -121,7 +121,7 @@ pub(super) fn try_report_anon_anon_conflict(&self) -> Option<ErrorReported> {
 
                 (Some(ret_span), _) => {
                     let sup_future = self.future_return_type(scope_def_id_sup);
-                    let (return_type, action) = if let Some(_) = sup_future {
+                    let (return_type, action) = if sup_future.is_some() {
                         ("returned future", "held across an await point")
                     } else {
                         ("return type", "returned")
@@ -140,7 +140,7 @@ pub(super) fn try_report_anon_anon_conflict(&self) -> Option<ErrorReported> {
                 }
                 (_, Some(ret_span)) => {
                     let sub_future = self.future_return_type(scope_def_id_sub);
-                    let (return_type, action) = if let Some(_) = sub_future {
+                    let (return_type, action) = if sub_future.is_some() {
                         ("returned future", "held across an await point")
                     } else {
                         ("return type", "returned")