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 @@ -563,13 +563,8 @@ &mut self, size: usize, ) -> Result<(HashSet, usize), GraphError> { - { - // we don't want to compute children_cache before this - // but doing it after extracting self.undecided takes a mutable - // ref to self while a shareable one is still active. - if self.undecided.len() <= size { - return Ok((self.undecided.clone(), size)); - } + if self.undecided.len() <= size { + return Ok((self.undecided.clone(), size)); } self.ensure_children_cache()?;