formatting

This commit is contained in:
Andre Bogus 2017-01-15 01:03:46 +01:00
parent dbde3b8e1c
commit 94c97d2ec9
2 changed files with 12 additions and 10 deletions

View File

@ -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)
}
_ => {}
},
_ => {},
}
}
}

View File

@ -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")
};