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) }