Skip to content

Commit 6367b00

Browse files
committed
Apply feedback
1 parent 3d0e0bb commit 6367b00

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clippy_lints/src/methods/cloned_last.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ use super::CLONED_LAST;
1010

1111
/// lint use of `cloned().next()` for `Iterators`
1212
pub(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,

0 commit comments

Comments
 (0)