fix Queue::last

This commit is contained in:
soruh 2023-08-14 17:05:43 +02:00
parent 89495ae3be
commit 2984c3244c
2 changed files with 5 additions and 1 deletions

View File

@ -265,7 +265,7 @@ impl<T: FromBytes + FromZeroes + AsBytes + Unaligned + Clone + Copy> FilePointer
res res
} }
pub fn last(self, reader: &impl ReaderTrait, index: u64) -> Option<T> { pub fn last(self, reader: &impl ReaderTrait) -> Option<T> {
self.get(reader, self.length(reader) - 1) self.get(reader, self.length(reader) - 1)
} }

View File

@ -937,6 +937,10 @@ fn queue() {
} }
} }
if !root.is_empty(transaction) {
assert_eq!(root.last(transaction), Some(U64::from(i - 1)));
}
root root
}); });