diff --git a/src/components/commitlist.rs b/src/components/commitlist.rs index 29dba8a1d1..502b02f454 100644 --- a/src/components/commitlist.rs +++ b/src/components/commitlist.rs @@ -603,14 +603,9 @@ impl CommitList { } /// - pub fn set_commits( - &mut self, - commits: Vec, - ) -> Result<()> { + pub fn set_commits(&mut self, commits: Vec) { self.commits = commits; - self.fetch_commits()?; - - Ok(()) + self.fetch_commits(); } fn select_next_highlight(&mut self) { @@ -666,32 +661,23 @@ impl CommitList { } /// - pub fn refresh_extend_data( - &mut self, - commits: Vec, - ) -> Result<()> { - log::info!("refresh_extend_data: {}", commits.len()); - + pub fn refresh_extend_data(&mut self, commits: Vec) { let new_commits = !commits.is_empty(); - self.commits.extend(commits.into_iter()); + self.commits.extend(commits); let selection = self.selection(); let selection_max = self.selection_max(); if self.needs_data(selection, selection_max) || new_commits { - self.fetch_commits()?; + self.fetch_commits(); } - - Ok(()) } - fn fetch_commits(&mut self) -> Result<()> { + fn fetch_commits(&mut self) { let want_min = self.selection().saturating_sub(SLICE_SIZE / 2); let commits = self.commits.len(); - log::info!("fetch_commits: {want_min}/{commits}"); - let want_min = want_min.min(commits); let slice_end = want_min.saturating_add(SLICE_SIZE).min(commits); @@ -710,19 +696,16 @@ impl CommitList { &self.highlights.clone(), ); } - - Ok(()) } /// pub fn set_highlighting( &mut self, highlighting: Option>, - ) -> Result<()> { + ) { self.highlights = highlighting; self.select_next_highlight(); - self.fetch_commits()?; - Ok(()) + self.fetch_commits(); } } diff --git a/src/tabs/revlog.rs b/src/tabs/revlog.rs index 1fc4f61c9d..f354945fda 100644 --- a/src/tabs/revlog.rs +++ b/src/tabs/revlog.rs @@ -136,12 +136,12 @@ impl Revlog { if self.update_search_state()? { if let Some(search) = self.search_result_set() { - self.list.set_highlighting(Some(search))?; + self.list.set_highlighting(Some(search)); } } self.list - .refresh_extend_data(self.git_log.extract_items()?)?; + .refresh_extend_data(self.git_log.extract_items()?); self.git_tags.request(Duration::from_secs(3), false)?; @@ -277,7 +277,7 @@ impl Revlog { self.search = LogSearch::Searching(async_find, options); - self.list.set_highlighting(None)?; + self.list.set_highlighting(None); } Ok(()) @@ -429,7 +429,7 @@ impl Component for Revlog { ) { if self.can_leave_search() { self.search = LogSearch::Off; - self.list.set_highlighting(None)?; + self.list.set_highlighting(None); return Ok(EventState::Consumed); } } else if key_match(k, self.key_config.keys.copy) { diff --git a/src/tabs/stashlist.rs b/src/tabs/stashlist.rs index 4afee72449..67e400873f 100644 --- a/src/tabs/stashlist.rs +++ b/src/tabs/stashlist.rs @@ -48,7 +48,7 @@ impl StashList { pub fn update(&mut self) -> Result<()> { if self.is_visible() { let stashes = sync::get_stashes(&self.repo.borrow())?; - self.list.set_commits(stashes)?; + self.list.set_commits(stashes); } Ok(())