Add Cursor::seek_end and audit the codebase to use seek_start more

This commit is contained in:
Antonio Scandurra
2021-06-10 14:05:56 +02:00
parent f294bfdbd9
commit dc2805bb14
4 changed files with 82 additions and 76 deletions
+4 -4
View File
@@ -1290,8 +1290,8 @@ impl WorktreeHandle for ModelHandle<Worktree> {
}
pub enum FileIter<'a> {
All(Cursor<'a, Entry, FileCount, FileCount>),
Visible(Cursor<'a, Entry, VisibleFileCount, VisibleFileCount>),
All(Cursor<'a, Entry, FileCount, ()>),
Visible(Cursor<'a, Entry, VisibleFileCount, ()>),
}
impl<'a> FileIter<'a> {
@@ -1310,11 +1310,11 @@ impl<'a> FileIter<'a> {
fn next_internal(&mut self) {
match self {
Self::All(cursor) => {
let ix = *cursor.start();
let ix = *cursor.seek_start();
cursor.seek_forward(&FileCount(ix.0 + 1), Bias::Right, &());
}
Self::Visible(cursor) => {
let ix = *cursor.start();
let ix = *cursor.seek_start();
cursor.seek_forward(&VisibleFileCount(ix.0 + 1), Bias::Right, &());
}
}