Skip to content
Myr

Ignore double_ended_iterator_last clippy lint

Before adoption: this commit came in with the history the project adopted, so no landing records it.

warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator --> src/error.rs:482:22 | 482 | self.chain().last().unwrap() | ^^^^^^ help: try: `next_back()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last = note: `-W clippy::double-ended-iterator-last` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::double_ended_iterator_last)]`

authored by David Tolnay · committed by David Tolnay · parent af0937e · Browse files · 1 file+1 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−0 removed

  • other:+1 added−0 removed

1 file+1 added−0 removed

modified:src/error.rs+1 added
476 unmodified lines
477 ///478 /// The root cause is the last error in the iterator produced by479 /// [`chain()`][Error::chain].480 #[cfg(any(feature = "std", not(anyhow_no_core_error)))]481 #[allow(clippy::double_ended_iterator_last)]482 pub fn root_cause(&self) -> &(dyn StdError + 'static) {483 self.chain().last().unwrap()484 }485
608 unmodified lines