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! {
4131
4131
/// ### What it does
4132
4132
///
4133
4133
/// 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(...)`.
4135
4135
///
4136
4136
/// ### Why is this bad?
4137
4137
///
@@ -4140,13 +4140,21 @@ declare_clippy_lint! {
4140
4140
/// range only to discard them.
4141
4141
///
4142
4142
/// ### Example
4143
+ ///
4143
4144
/// ```no_run
4144
4145
/// let random_numbers : Vec<_> = (0..10).map(|_| { 3 + 1 }).collect();
4145
4146
/// ```
4146
4147
/// Use instead:
4147
4148
/// ```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();
4149
4150
/// ```
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.
4150
4158
#[ clippy:: version = "1.81.0" ]
4151
4159
pub MAP_WITH_UNUSED_ARGUMENT_OVER_RANGES ,
4152
4160
style,
You can’t perform that action at this time.
0 commit comments