Comments (1)
This lint exists: https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_clone
With #![warn(clippy::redundant_clone)]
:
warning: redundant clone
--> src/main.rs:6:9
|
6 | .to_string()
| ^^^^^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> src/main.rs:4:5
|
4 | / x
5 | | .to_string()
6 | | .to_string()
| |________^
The lint is currently opt-in because it has way too many false positives, see: https://github.com/rust-lang/rust-clippy/issues?q=is%3Aissue+redundant_clone
The PR #11364 reworks it.
from rust-clippy.
Related Issues (20)
- FP ref_as_ptr: things that cannot const drop
- incompatible_msrv false positive: tests
- Idea: lint initialising structs with non-`pub` fields outside of their initialisers
- `to_string_trait_impl` does not account for specialized implementations
- `missing_panics_doc` with `check-private-items` should not trigger on tests
- Unnecessary parentheses in suggested fix for `needless_borrow` HOT 1
- lint_groups_priority is raised for `rust_2018_idioms = "deny", warnings = "deny"`
- False positive with `map_clone` HOT 1
- `incompatible_msrv` thinks `.await` is stabilized since 1.64 while it's not
- complexity: use `extend` instead of `append` HOT 1
- no_effect_underscore_binding fires on ignored parameters of async fns HOT 1
- `incompatible_msrv` false positive: Trait methods of the same name
- `tracing::instrument` triggers `blocks_in_conditions` HOT 5
- ice: upper case acronyms, `unnamed_fields`
- `pub_underscore_fields`: `#[allow]` doesn't work on the field that is linted HOT 1
- Suggest ! return type for functions that never return a value HOT 4
- #[tracing::instrument()] triggers infinite_loop HOT 2
- unnecessary_unwrap not produced in 1.76 HOT 1
- Add a flag to exit with a non-zero status code on warnings HOT 3
- rust-1.76.0 is missing from https://rust-lang.github.io/rust-clippy/ HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-clippy.