mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
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:
parent
2872e05589
commit
d3dbf9c194
15 changed files with 22 additions and 26 deletions
|
@ -62,7 +62,7 @@ fn fix_path_for_mac(sh: &Shell) -> Result<()> {
|
|||
let mut paths = env::split_paths(&vars).collect::<Vec<_>>();
|
||||
paths.append(&mut vscode_path);
|
||||
let new_paths = env::join_paths(paths).context("build env PATH")?;
|
||||
sh.set_var("PATH", &new_paths);
|
||||
sh.set_var("PATH", new_paths);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue