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