File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -10,15 +10,14 @@ use super::CLONED_LAST;
1010
1111/// lint use of `cloned().next()` for `Iterators`
1212pub ( super ) fn check < ' tcx > ( cx : & LateContext < ' tcx > , expr : & ' tcx hir:: Expr < ' _ > , recv : & ' tcx hir:: Expr < ' _ > ) {
13- // lint if caller of `.filter ().next()` is an Iterator
13+ // lint if caller of `.cloned ().next()` is an Iterator
1414 let recv_impls_iterator = cx. tcx . get_diagnostic_item ( sym:: Iterator ) . map_or ( false , |id| {
1515 implements_trait ( cx, cx. typeck_results ( ) . expr_ty ( recv) , id, & [ ] )
1616 } ) ;
1717 if recv_impls_iterator {
1818 let msg = "called `cloned().last()` on an `Iterator`. It may be more efficient to call
1919 `.last().clone()` instead" ;
2020 let iter_snippet = snippet ( cx, recv. span , ".." ) ;
21- // add note if not multi-line
2221 span_lint_and_sugg (
2322 cx,
2423 CLONED_LAST ,
You can’t perform that action at this time.
0 commit comments