adding condition for map_clone message

if msrv < 1.36, the message tells , but the suggestion is
This commit is contained in:
kyoto7250 2022-04-12 04:03:48 +09:00
parent 89ee6aa6e3
commit 9716a9eff0
2 changed files with 2 additions and 2 deletions

View File

@ -143,7 +143,7 @@ fn lint_needless_cloning(cx: &LateContext<'_>, root: Span, receiver: Span) {
impl MapClone {
fn lint_explicit_closure(&self, cx: &LateContext<'_>, replace: Span, root: Span, is_copy: bool) {
let mut applicability = Applicability::MachineApplicable;
let message = if is_copy {
let message = if is_copy && meets_msrv(self.msrv.as_ref(), &msrvs::ITERATOR_COPIED) {
"you are using an explicit closure for copying elements"
} else {
"you are using an explicit closure for cloning elements"

View File

@ -1,4 +1,4 @@
error: you are using an explicit closure for copying elements
error: you are using an explicit closure for cloning elements
--> $DIR/min_rust_version.rs:74:26
|
LL | let _: Option<u64> = Some(&16).map(|b| *b);