blob: 72a6ead47a9317b907e2b17406e76f9734b69685 [file] [log] [blame]
error: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
--> tests/ui/double_ended_iterator_last.rs:5:5
|
LL | s.split(' ').last()
| ^^^^^^^^^^^^^------
| |
| help: try: `next_back()`
|
= note: `-D clippy::double-ended-iterator-last` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::double_ended_iterator_last)]`
error: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
--> tests/ui/double_ended_iterator_last.rs:22:13
|
LL | let _ = DeIterator.last();
| ^^^^^^^^^^^------
| |
| help: try: `next_back()`
error: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
--> tests/ui/double_ended_iterator_last.rs:109:36
|
LL | println!("Last element is {}", v.last().unwrap().0);
| ^^^^^^^^
|
= note: this change will alter drop order which may be undesirable
help: try
|
LL ~ let mut v = DropDeIterator(v.into_iter());
LL ~ println!("Last element is {}", v.next_back().unwrap().0);
|
error: aborting due to 3 previous errors