Skip to content

Commit 4d71a84

Browse files
committed
Ignore double_ended_iterator_last clippy lint
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)]`
1 parent af0937e commit 4d71a84

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/error.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ impl Error {
478478
/// The root cause is the last error in the iterator produced by
479479
/// [`chain()`][Error::chain].
480480
#[cfg(any(feature = "std", not(anyhow_no_core_error)))]
481+
#[allow(clippy::double_ended_iterator_last)]
481482
pub fn root_cause(&self) -> &(dyn StdError + 'static) {
482483
self.chain().last().unwrap()
483484
}

0 commit comments

Comments
 (0)