This is an archive of the discontinued Mercurial Phabricator instance.

rust-dagops: range of revisions
ClosedPublic

Authored by gracinet on Apr 12 2019, 2:33 PM.

Details

Summary

This is a Rust implementation for what reachableroots2() does if
includepath is True.

The algorithmic details and performance notes are included in the
documentation comment.

Our main use case for now is a Rust counterpart of the partialdiscovery
object, so we don't really need bindings yet.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

gracinet created this revision.Apr 12 2019, 2:33 PM
kevincox accepted this revision.Apr 14 2019, 3:45 PM
kevincox added inline comments.
rust/hg-core/src/dagops.rs
140

Can you use:

for rev in heads_ancestors.into_iter().rev() {
   // ...
}
215

Can you use .into_iter() instead of .iter().cloned()?

gracinet marked 2 inline comments as done.Apr 15 2019, 5:50 AM
gracinet added inline comments.
rust/hg-core/src/dagops.rs
140

Ah yes, thanks, I've been looking for something like that on DoubleEndedIterator and couldn't find it, because it's actually on Iterator with a where Self: DoubleEndedIterator.

215

Sure, I should probably take more advantage of such cases, where we don't need the original object anymore.

gracinet marked 2 inline comments as done.Apr 15 2019, 6:10 AM
gracinet updated this revision to Diff 14740.

@kevincox, thanks for the review, updated version available.

This revision was automatically updated to reflect the committed changes.