about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-10-15 19:58:52 +0000
committerbors <bors@rust-lang.org>2019-10-15 19:58:52 +0000
commit52cebb1f8f8789b97d243c07bf4c961ca0017f7b (patch)
tree451c1229ef510305ceb79e3e2049f87d9345d5cb
parentddb5cb787df35c50318dba5d3f40e98287f4123f (diff)
parent608d09c26c9fecdb166fceb3969bca4c4876ea8e (diff)
downloadrust-52cebb1f8f8789b97d243c07bf4c961ca0017f7b.tar.gz
rust-52cebb1f8f8789b97d243c07bf4c961ca0017f7b.zip
Auto merge of #4673 - Manishearth:rustup, r=phansch
Rustup to rustc 1.40.0-nightly (237d54ff6 2019-10-15)

changelog: none
-rw-r--r--clippy_lints/src/booleans.rs5
-rw-r--r--clippy_lints/src/functions.rs9
2 files changed, 10 insertions, 4 deletions
diff --git a/clippy_lints/src/booleans.rs b/clippy_lints/src/booleans.rs
index c5da0af6f4d..aaddbdcae6a 100644
--- a/clippy_lints/src/booleans.rs
+++ b/clippy_lints/src/booleans.rs
@@ -255,7 +255,10 @@ fn simplify_not(cx: &LateContext<'_, '_>, expr: &Expr) -> Option<String> {
                 .iter()
                 .cloned()
                 .flat_map(|(a, b)| vec![(a, b), (b, a)])
-                .find(|&(a, _)| a == path.ident.name.as_str())
+                .find(|&(a, _)| {
+                    let path: &str = &path.ident.name.as_str();
+                    a == path
+                })
                 .and_then(|(_, neg_method)| Some(format!("{}.{}()", snippet_opt(cx, args[0].span)?, neg_method)))
         },
         _ => None,
diff --git a/clippy_lints/src/functions.rs b/clippy_lints/src/functions.rs
index 5b2619aa9ba..9844df3c650 100644
--- a/clippy_lints/src/functions.rs
+++ b/clippy_lints/src/functions.rs
@@ -462,9 +462,12 @@ fn check_must_use_candidate<'a, 'tcx>(
 }
 
 fn must_use_attr(attrs: &[Attribute]) -> Option<&Attribute> {
-    attrs
-        .iter()
-        .find(|attr| attr.ident().map_or(false, |ident| "must_use" == &ident.as_str()))
+    attrs.iter().find(|attr| {
+        attr.ident().map_or(false, |ident| {
+            let ident: &str = &ident.as_str();
+            "must_use" == ident
+        })
+    })
 }
 
 fn returns_unit(decl: &hir::FnDecl) -> bool {