Skip to content

Commit

Permalink
Auto merge of #4673 - Manishearth:rustup, r=phansch
Browse files Browse the repository at this point in the history
Rustup to rustc 1.40.0-nightly (237d54f 2019-10-15)

changelog: none
  • Loading branch information
bors committed Oct 15, 2019
2 parents ddb5cb7 + 608d09c commit 52cebb1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion clippy_lints/src/booleans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 6 additions & 3 deletions clippy_lints/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 52cebb1

Please sign in to comment.