From 20d3f16a540e629ee3829c8a3d90269156918a13 Mon Sep 17 00:00:00 2001 From: "Jamil Lambert, PhD" Date: Mon, 20 Jan 2025 16:43:48 +0000 Subject: [PATCH] Fix clippy lint in new rustc nightly New nightly lint warning "called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator" Code that gives the warning is correct, allow the lint to remove the warning. Update rustc nightly to 2025-01-16 --- bitcoin/src/taproot/merkle_branch.rs | 1 + nightly-version | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bitcoin/src/taproot/merkle_branch.rs b/bitcoin/src/taproot/merkle_branch.rs index c629eacb6..10b2d0718 100644 --- a/bitcoin/src/taproot/merkle_branch.rs +++ b/bitcoin/src/taproot/merkle_branch.rs @@ -252,6 +252,7 @@ impl Iterator for IntoIter { fn nth(&mut self, n: usize) -> Option { self.0.nth(n) } #[inline] + #[allow(clippy::double_ended_iterator_last)] // False positive. Using `.last()` on a `vec::IntoIter` is correct. fn last(self) -> Option { self.0.last() } #[inline] diff --git a/nightly-version b/nightly-version index ecd2b22dc..4b004c97e 100644 --- a/nightly-version +++ b/nightly-version @@ -1 +1 @@ -nightly-2025-01-10 +nightly-2025-01-16