Skip to content

Commit

Permalink
Resolve needless_borrow clippy lint
Browse files Browse the repository at this point in the history
    warning: this expression creates a reference which is immediately dereferenced by the compiler
      --> src/main.rs:92:34
       |
    92 |             options += &packages[&member].name;
       |                                  ^^^^^^^ help: change this to: `member`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
       = note: `#[warn(clippy::needless_borrow)]` on by default
  • Loading branch information
dtolnay committed Feb 10, 2024
1 parent cf72d7d commit 3c67eee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn do_main() -> Result<()> {
let mut options = String::new();
for (i, member) in metadata.workspace_members.iter().enumerate() {
options += if i == 0 { "" } else { " | " };
options += &packages[&member].name;
options += &packages[member].name;
}
bail!(
"Pass `-p [{}]` to select a single workspace member",
Expand Down

0 comments on commit 3c67eee

Please sign in to comment.