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
This commit is contained in:
Jamil Lambert, PhD 2025-01-20 16:43:48 +00:00
parent 39dd3cad20
commit 20d3f16a54
No known key found for this signature in database
GPG Key ID: 54DC29234AB5D2C0
2 changed files with 2 additions and 1 deletions

View File

@ -252,6 +252,7 @@ impl Iterator for IntoIter {
fn nth(&mut self, n: usize) -> Option<Self::Item> { 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::Item> { self.0.last() }
#[inline]

View File

@ -1 +1 @@
nightly-2025-01-10
nightly-2025-01-16