Comments (1)
Similarly, I've seen
let mut i = 0;
for val in v.iter() {
//...
i += 1;
}
which would be better expressed with .iter().enumerate()
.
from rust-clippy.
Related Issues (20)
- False positive: useless_asref when used to go from `&&T` to `&T` HOT 1
- Lint telling me to needlessly increase memory footprint HOT 5
- `non_canonical_clone_impl` should skip proc macros HOT 2
- Format error in suggestion for `needless_lifetimes`
- Suggested lint: avoid `&mut` to `*const` coercions HOT 6
- `impl_trait_in_params` doesn't work for non-public functions HOT 2
- `match` with default branch that would better be `let-else`. HOT 3
- doc_markdown scope problem HOT 1
- Lint against `super` (and `self`) imports HOT 2
- Warn about missing `#[inline]` on trivial public methods HOT 4
- `assigning_clones` complains about `static str` -> `String` assignment.
- Warn for passing `Box<&dyn Any>` to function taking `&dyn std::any::Any` HOT 3
- `let_and_return` suggestion causes error when operation between if-expression without parentheses and some value is performed in `let`-binding
- `#[expect(...)]` attribute not working for `clippy::unsafe_derive_deserialize`
- `unnecessary_to_owned` suggestion changes maybe-cloning to always-cloning
- `iter_on_empty_collections`'s suggestion causes a compilation error HOT 1
- needless_pub_self lint when necessary for crate macros HOT 1
- `clippy::used_underscore_binding` fires on an unused function parameter
- `cargo clippy` does not lint tests, code in bin/ but `cargo clippy --fix` does HOT 2
- Lint for trailing comma in macro parameters 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.