Skip to content

Conversation

ilya-bobyr
Copy link
Contributor

cargo clippy suggests removal of borrows in a number of locations. Seems like the standard library has changed to allow for borrows to be omitted on the result of format! and in a few other cases.

https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

CONTRIBUTING.md suggests one runs this, before publishing a change:

cargo clippy --all --all-targets --all-features -- -D warnings`

But, at the moment, this command generated more than a thousand warnings for me on master.

This particular warning is responsible for about 50 cases.

This change is just cargo clippy --fix, with flags to only show clippy::needless_borrow, followed by cargo fmt.

`cargo clippy` suggests removal of borrows in a number of locations.
Seems like the standard library has changed to allow for borrows to be
omitted on the result of `format!` and in a few other cases.

https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

`CONTRIBUTING.md` suggests one runs this, before publishing a change:
```bash
cargo clippy --all --all-targets --all-features -- -D warnings`
```
But, at the moment, this command generated more than a thousand warnings
for me on `master`.

This particular warning is responsible for about 50 cases.

This change is just `cargo clippy --fix`, with flags to only show
`clippy::needless_borrow`, followed by `cargo fmt`.
@0xPoe
Copy link
Member

0xPoe commented Feb 8, 2023

Duplicate of #3199 Thanks!

@ilya-bobyr ilya-bobyr closed this Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants