Open
Description
What it does
Suggests using slice::fill
instead of a manual loop
Advantage
- Makes code simpler
- Suggestion is better than that of
needless_range_loop
Drawbacks
Uses a less known function (slice::fill
)
Example
for i in 0..some_slice.len() {
some_slice[i] = 0;
}
Could be written as:
some_slice.fill(0);