From 301a3a1b8766bd632d0a9ecb93bd8d5d74ad6c6b Mon Sep 17 00:00:00 2001 From: Richard Menzies <52405405+WizardOhio24@users.noreply.github.com> Date: Tue, 23 Feb 2021 09:59:10 +0000 Subject: [PATCH] Fix build (#525) --- asyncgit/src/sync/logwalker.rs | 12 +++++------- asyncgit/src/sync/remotes.rs | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/asyncgit/src/sync/logwalker.rs b/asyncgit/src/sync/logwalker.rs index bd259655..2b785cc4 100644 --- a/asyncgit/src/sync/logwalker.rs +++ b/asyncgit/src/sync/logwalker.rs @@ -32,14 +32,12 @@ impl<'a> LogWalker<'a> { } if let Some(ref mut walk) = self.revwalk { - for id in walk { - if let Ok(id) = id { - out.push(id.into()); - count += 1; + for id in walk.into_iter().flatten() { + out.push(id.into()); + count += 1; - if count == limit { - break; - } + if count == limit { + break; } } } diff --git a/asyncgit/src/sync/remotes.rs b/asyncgit/src/sync/remotes.rs index 86d59a07..65dd3094 100644 --- a/asyncgit/src/sync/remotes.rs +++ b/asyncgit/src/sync/remotes.rs @@ -61,7 +61,7 @@ pub fn get_remotes(repo_path: &str) -> Result> { let repo = utils::repo(repo_path)?; let remotes = repo.remotes()?; let remotes: Vec = - remotes.iter().filter_map(|s| s).map(String::from).collect(); + remotes.iter().flatten().map(String::from).collect(); Ok(remotes) }