D7529: rust-dirstate-status: add `walk_explicit` implementation, use `Matcher` trait

kevincox (Kevin Cox) phabricator at mercurial-scm.org
Mon Dec 2 13:26:21 UTC 2019


This revision now requires changes to proceed.
kevincox added inline comments.
kevincox requested changes to this revision.

INLINE COMMENTS

> status.rs:125
> +/// TODO subrepos
> +fn walk_explicit<'a: 'c, 'b: 'c, 'c>(
> +    files: &'a HashSet<&HgPath>,

It seems to me that you can just use one lifetime here since the two input limit the output.

https://rust.godbolt.org/z/57bf6T But maybe I over-simplified the problem.

> status.rs:168
> +                        return Some(Ok((normalized, Dispatch::Removed)));
> +                    }
> +                }

Isn't this the same as the first case? Can we just remove the first case?

> status.rs:244
> +    results: impl IntoIterator<Item = IoResult<(&'a HgPath, Dispatch)>>,
> +) -> IoResult<(Vec<&'a HgPath>, StatusResult<'a>)> {
>      let mut lookup = vec![];

It surprises me this annotation is required? I thought this would be the assumed meaning.

REPOSITORY
  rHG Mercurial

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

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

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


More information about the Mercurial-devel mailing list