Impl FusedIterator for IdxRange

This commit is contained in:
oxalica 2023-05-06 22:02:30 +08:00
parent 665c0cb547
commit add94d3b9c

View file

@ -6,7 +6,7 @@
use std::{
cmp, fmt,
hash::{Hash, Hasher},
iter::Enumerate,
iter::{Enumerate, FusedIterator},
marker::PhantomData,
ops::{Index, IndexMut, Range, RangeInclusive},
};
@ -212,6 +212,8 @@ impl<T> DoubleEndedIterator for IdxRange<T> {
impl<T> ExactSizeIterator for IdxRange<T> {}
impl<T> FusedIterator for IdxRange<T> {}
impl<T> fmt::Debug for IdxRange<T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_tuple(&format!("IdxRange::<{}>", std::any::type_name::<T>()))