diff --git a/clippy_lints/src/methods.rs b/clippy_lints/src/methods.rs index 4d48ff45c..578fda8e7 100644 --- a/clippy_lints/src/methods.rs +++ b/clippy_lints/src/methods.rs @@ -786,11 +786,11 @@ fn lint_or_fun_call(cx: &LateContext, expr: &hir::Expr, name: &str, args: &[hir: if !check_unwrap_or_default(cx, name, fun, &args[0], &args[1], or_has_args, expr.span) { check_general_case(cx, name, fun.span, &args[0], &args[1], or_has_args, expr.span); } - } + }, hir::ExprMethodCall(fun, _, ref or_args) => { check_general_case(cx, name, fun.span, &args[0], &args[1], !or_args.is_empty(), expr.span) - } - _ => {} + }, + _ => {}, } } } diff --git a/src/main.rs b/src/main.rs index 386107018..036adae83 100644 --- a/src/main.rs +++ b/src/main.rs @@ -234,13 +234,15 @@ pub fn main() { } else { option_env!("SYSROOT") .map(|s| s.to_owned()) - .or_else(|| Command::new("rustc") - .arg("--print") - .arg("sysroot") - .output() - .ok() - .and_then(|out| String::from_utf8(out.stdout).ok()) - .map(|s| s.trim().to_owned())) + .or_else(|| { + Command::new("rustc") + .arg("--print") + .arg("sysroot") + .output() + .ok() + .and_then(|out| String::from_utf8(out.stdout).ok()) + .map(|s| s.trim().to_owned()) + }) .expect("need to specify SYSROOT env var during clippy compilation, or use rustup or multirust") };