D7794: rust-nodemap: generic NodeTreeVisitor

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Jan 22 14:18:46 EST 2020


martinvonz added inline comments.

INLINE COMMENTS

> nodemap.rs:264-269
> +            Element::None => (true, None),
> +            Element::Rev(r) => (true, Some(r)),
> +            Element::Block(idx) => {
> +                self.visit = idx;
> +                (false, None)
> +            }

There will only be a valid result if this is a leaf, so it might be better to combine `leaf` and `opt` into one `Option<Option<Revision>>` so the caller cannot mistake a `opt=None` for "missing" when `leaf=false`.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7794/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7794

To: gracinet, #hg-reviewers, kevincox
Cc: martinvonz, durin42, kevincox, mercurial-devel


More information about the Mercurial-devel mailing list