Skip to content

Commit a4a3f61

Browse files
committed
Auto merge of #7602 - flip1995:needless_collect_appl, r=xFrednet
Set applicability of needless_collect to MaybeIncorrect Fixes rust-lang/rust#88333 changelog: Set applicability of [`needless_collect`] to MaybeIncorrect
2 parents 387dbd7 + c6e4202 commit a4a3f61

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/loops/needless_collect.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fn check_needless_collect_direct_usage<'tcx>(expr: &'tcx Expr<'_>, cx: &LateCont
2626
if chain_method.ident.name == sym!(collect) && is_trait_method(cx, &args[0], sym::Iterator);
2727
then {
2828
let ty = cx.typeck_results().expr_ty(&args[0]);
29-
let mut applicability = Applicability::MachineApplicable;
29+
let mut applicability = Applicability::MaybeIncorrect;
3030
let is_empty_sugg = "next().is_none()".to_string();
3131
let method_name = &*method.ident.name.as_str();
3232
let sugg = if is_type_diagnostic_item(cx, ty, sym::vec_type) ||
@@ -113,7 +113,7 @@ fn check_needless_collect_indirect_usage<'tcx>(expr: &'tcx Expr<'_>, cx: &LateCo
113113
(stmt.span, String::new()),
114114
(iter_call.span, iter_replacement)
115115
],
116-
Applicability::MachineApplicable,// MaybeIncorrect,
116+
Applicability::MaybeIncorrect,
117117
);
118118
},
119119
);

0 commit comments

Comments
 (0)