From decf11c838bbb92bbf77bca407c575a3c9b6dbc7 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 14 Jun 2026 18:34:20 +0900 Subject: [PATCH] history file: inline a function --- src/history/file.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) 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) } }