mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-09-20 22:51:58 +00:00
formatting
This commit is contained in:
parent
dbde3b8e1c
commit
94c97d2ec9
2 changed files with 12 additions and 10 deletions
|
@ -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)
|
||||
}
|
||||
_ => {}
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
16
src/main.rs
16
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")
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue