gracinet created this revision.
Herald added subscribers: mercurial-devel, kevincox, durin42.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
with the removal of the various ensure() it's become
clear that this doesn't have error cases any more, and we didn't
need the full match at the end.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D7722
AFFECTED FILES
rust/hg-core/src/discovery.rs
CHANGE DETAILS
diff --git a/rust/hg-core/src/discovery.rs b/rust/hg-core/src/discovery.rs
--- a/rust/hg-core/src/discovery.rs
+++ b/rust/hg-core/src/discovery.rs
@@ -266,7 +266,7 @@
self.mutate_undecided(
|oc| oc.compute_undecided(),
-|wu| wu.add_missing_revisions(missing),
+|wu| Ok(wu.add_missing_revisions(missing)),
)
}
@@ -456,10 +456,7 @@
/// caller from `PartialDiscovery` can avoid the undecided set in case
/// it turns out to be empty (hence restrain
/// from performing the transition to `WithUndecided`)
-pub fn add_missing_revisions(
-&mut self,
-mut tovisit: VecDeque,
-) -> Result<(), GraphError> {
+pub fn add_missing_revisions(&mut self, mut tovisit: VecDeque) {
let mut seen: HashSet = HashSet::new();
let undecided_mut = &mut self.undecided;
let children = &self.children_cache;
@@ -473,20 +470,14 @@
continue;
}
undecided_mut.remove(&rev);
-match children.get(&rev) {
-None => {
-continue;
-}
-Some(this_children) => {
-for child in this_children.iter().cloned() {
-if seen.insert(child) {
-tovisit.push_back(child);
-}
+if let Some(this_children) = children.get(&rev) {
+for child in this_children.iter().cloned() {
+if seen.insert(child) {
+tovisit.push_back(child);
}
}
}
}
-Ok(())
}
fn compute_children_cache(
To: gracinet, #hg-reviewers
Cc: durin42, kevincox, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel