diff --git a/src/history/file.rs b/src/history/file.rs index 278cc6cdb..ed83aed03 100644 --- a/src/history/file.rs +++ b/src/history/file.rs @@ -168,14 +168,6 @@ pub fn decode_item(&self, offset: usize) -> Option { decode_item_fish_2_0(contents) } - /// Support for iterating item offsets. - /// The cursor should initially be 0. - /// If cutoff is given, skip items whose timestamp is newer than cutoff. - /// Returns the offset of the next item, or [`None`] on end. - fn offset_of_next_item(&self, cursor: &mut usize, cutoff: Option) -> Option { - offset_of_next_item_fish_2_0(self.contents(), cursor, cutoff) - } - /// Returns an iterator over item offsets with an optional cutoff time. /// If cutoff is given, skip items whose timestamp is newer than cutoff. pub fn offsets(&self, cutoff: Option) -> impl Iterator + '_ { @@ -249,8 +241,9 @@ impl<'a> Iterator for HistoryFileOffsetIter<'a> { type Item = usize; fn next(&mut self) -> Option { - self.contents - .offset_of_next_item(&mut self.cursor, self.cutoff) + let cursor: &mut usize = &mut self.cursor; + let cutoff = self.cutoff; + offset_of_next_item_fish_2_0(self.contents.contents(), cursor, cutoff) } }