[−][src]Function hg::dagops::heads
pub fn heads<'a>(
graph: &impl Graph,
iter_revs: impl Clone + Iterator<Item = &'a Revision>
) -> Result<HashSet<Revision>, GraphError>
Relative heads out of some revisions, passed as an iterator.
These heads are defined as those revisions that have no children among those emitted by the iterator.
Performance notes
Internally, this clones the iterator, and builds a HashSet
out of it.
This function takes an Iterator
instead of impl IntoIterator
to
guarantee that cloning the iterator doesn't result in cloning the full
construct it comes from.