diff --git a/rust/hg-core/src/dirstate/dirs_multiset.rs b/rust/hg-core/src/dirstate/dirs_multiset.rs --- a/rust/hg-core/src/dirstate/dirs_multiset.rs +++ b/rust/hg-core/src/dirstate/dirs_multiset.rs @@ -11,9 +11,12 @@ use crate::{ dirstate::EntryState, utils::files, DirstateEntry, DirstateMapError, }; -use std::collections::hash_map::Entry; +use std::collections::hash_map::{self, Entry}; use std::collections::HashMap; +// could be encapsulated if we care API stability more seriously +pub type DirsMultisetIter<'a> = hash_map::Keys<'a, Vec, u32>; + #[derive(PartialEq, Debug)] pub struct DirsMultiset { inner: HashMap, u32>, @@ -105,7 +108,7 @@ impl DirsMultiset { self.inner.contains_key(key) } - pub fn iter(&self) -> impl Iterator> { + pub fn iter(&self) -> DirsMultisetIter { self.inner.keys() } diff --git a/rust/hg-core/src/lib.rs b/rust/hg-core/src/lib.rs --- a/rust/hg-core/src/lib.rs +++ b/rust/hg-core/src/lib.rs @@ -9,7 +9,7 @@ mod dirstate; pub mod discovery; pub mod testing; // unconditionally built, for use from integration tests pub use dirstate::{ - dirs_multiset::DirsMultiset, + dirs_multiset::{DirsMultiset, DirsMultisetIter}, dirstate_map::DirstateMap, parsers::{pack_dirstate, parse_dirstate, PARENT_SIZE}, CopyMap, DirstateEntry, DirstateParents, EntryState, StateMap,