File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -4131,7 +4131,7 @@ declare_clippy_lint! {
41314131 /// ### What it does
41324132 ///
41334133 /// Checks for `Iterator::map` over ranges without using the parameter which
4134- /// could be more clearly expressed using `std::iter::repeat_with (...).take(...)`.
4134+ /// could be more clearly expressed using `std::iter::repeat (...).take(...)`.
41354135 ///
41364136 /// ### Why is this bad?
41374137 ///
@@ -4140,13 +4140,21 @@ declare_clippy_lint! {
41404140 /// range only to discard them.
41414141 ///
41424142 /// ### Example
4143+ ///
41434144 /// ```no_run
41444145 /// let random_numbers : Vec<_> = (0..10).map(|_| { 3 + 1 }).collect();
41454146 /// ```
41464147 /// Use instead:
41474148 /// ```no_run
4148- /// let f : Vec<_> = std::iter::repeat_with(|| { 3 + 1 } ).take(10).collect();
4149+ /// let f : Vec<_> = std::iter::repeat( 3 + 1 ).take(10).collect();
41494150 /// ```
4151+ ///
4152+ /// ### Known Issues
4153+ ///
4154+ /// This lint suggest replacing a `Map<Range>` with a `Take<RepeatWith>` or
4155+ /// `Take<Repeat>`. The former implements some traits that the latter two do
4156+ /// not, such as `DoubleEndedIterator`. As a result, this may not always be an
4157+ /// appropriate suggestion.
41504158 #[ clippy:: version = "1.81.0" ]
41514159 pub MAP_WITH_UNUSED_ARGUMENT_OVER_RANGES ,
41524160 style,
You can’t perform that action at this time.
0 commit comments