4 comments (4 comments)1 reaction (1 reaction)1 assignee (1 assignee)Rust1,391 forks (1,391 forks)batch import
C-enhancementL-stylegood first issue
Repository metrics
- Stars
- 10,406 stars (10,406 stars)
- PR merge metrics
- Avg merge 19d 22h (Avg merge 19d 22h)113 merged PRs in 30d (113 merged PRs in 30d)
Description
Enhancements for manual_flatten
-
for_each
Before:
iter.for_each(|o| {
if let Some(x) = o { //.. }
})
After
iter.flatten().for_each(|o| //..)
-
nested loops
Before:
for x in vec![vec![1]] {
for y in x {
//.. x is not used again
}
}
After:
for x in vec![vec![1]].into_iter().flatten() {
// ..
}
Contributor guide
- Research direction
- Implement new patterns for manual flatten lint: detect `for each` with Option and flatten, and nested loops whose inner loop can be replaced with flatten. Study existing manual flatten implementation in clippy and add new match arms.
- Tech stack
- rust
- Domain
- developer experiencetooling
- Issue type
- Feature
- Prerequisites
- Rust