Moar linting: needless_borrow, let_unit_value, ...

* There are a few needless borrows that don't seem to be needed. I even did a quick assembly comparison and posted a q to stackoveflow on it. See [here](https://stackoverflow.com/questions/74910196/advantages-of-pass-by-ref-val-with-impl-intoiteratoritem-impl-asrefstr)
* removed several `let _ = ...` when they don't look necessary (even a few ones that were not suggested by clippy (?))
* there were a few `then(|| ctor{})` that clippy suggested to replace with `then_some(ctor{})` -- seems reasonable?
* some unneeded assignment+return - keep the code a bit leaner
* a few `writeln!` instead of `write!`, or even consolidate write!
* a nice optimization to use `ch.is_ascii_digit` instead of `ch.is_digit(10)`
This commit is contained in:
Yuri Astrakhan 2022-12-24 16:09:08 -05:00
parent 2872e05589
commit d3dbf9c194
15 changed files with 22 additions and 26 deletions

View file

@ -297,11 +297,11 @@ impl FlycheckActor {
let mut cmd = Command::new(toolchain::cargo());
cmd.arg(command);
cmd.current_dir(&self.root);
cmd.args(&["--workspace", "--message-format=json", "--manifest-path"])
cmd.args(["--workspace", "--message-format=json", "--manifest-path"])
.arg(self.root.join("Cargo.toml").as_os_str());
for target in target_triples {
cmd.args(&["--target", target.as_str()]);
cmd.args(["--target", target.as_str()]);
}
if *all_targets {
cmd.arg("--all-targets");