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 @@ -4132,7 +4132,7 @@ declare_clippy_lint! {
41324132 /// ### What it does
41334133 ///
41344134 /// Checks for `Iterator::map` over ranges without using the parameter which
4135- /// could be more clearly expressed using `std::iter::repeat_with (...).take(...)`.
4135+ /// could be more clearly expressed using `std::iter::repeat (...).take(...)`.
41364136 ///
41374137 /// ### Why is this bad?
41384138 ///
@@ -4141,13 +4141,21 @@ declare_clippy_lint! {
41414141 /// range only to discard them.
41424142 ///
41434143 /// ### Example
4144+ ///
41444145 /// ```no_run
41454146 /// let random_numbers : Vec<_> = (0..10).map(|_| { 3 + 1 }).collect();
41464147 /// ```
41474148 /// Use instead:
41484149 /// ```no_run
4149- /// let f : Vec<_> = std::iter::repeat_with(|| { 3 + 1 } ).take(10).collect();
4150+ /// let f : Vec<_> = std::iter::repeat( 3 + 1 ).take(10).collect();
41504151 /// ```
4152+ ///
4153+ /// ### Known Issues
4154+ ///
4155+ /// This lint suggest replacing a `Map<Range>` with a `Take<RepeatWith>` or
4156+ /// `Take<Repeat>`. The former implements some traits that the latter two do
4157+ /// not, such as `DoubleEndedIterator`. As a result, this may not always be an
4158+ /// appropriate suggestion.
41514159 #[ clippy:: version = "1.81.0" ]
41524160 pub MAP_WITH_UNUSED_ARGUMENT_OVER_RANGES ,
41534161 style,
You can’t perform that action at this time.
0 commit comments