manual_str_repeat
should trigger for repeat_n
with msrv 1.82
#13784
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-negative
Issue: The lint should have been triggered on code, but wasn't
Summary
Since Rust 1.82.0 users can replace
std::iter::repeat(x).take(m).collect::<String>()
by the (almost equivalent)std::iter::repeat_n(x,m).collect::<String>()
. Both are manual versions of string repeat, but only the former emits a warning.Playground link
I would be happy to try to contribute a PR for this if the maintainers agree that this is a false negative.
Thanks for clippy, it's the best!
Lint Name
manual_str_repeat
Reproducer
I tried this code:
I expected to see this happen:
Instead, this happened:
(no warning emitted)
The text was updated successfully, but these errors were encountered: