D7909: rust-filepatterns: add support for `ignore` and `subignore` patterns

kevincox (Kevin Cox) phabricator at mercurial-scm.org
Thu Jan 16 10:30:29 EST 2020


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

INLINE COMMENTS

> filepatterns.rs:456
> +        .into_iter()
> +        .filter_map(|entry| -> Option<PatternResult<_>> {
> +            let IgnorePattern {

I don't see anywhere where this returns `None`. Should this just be `.map()` or `.flat_map()`?

> filepatterns.rs:462
> +            } = &entry;
> +            let mut res = vec![];
> +            match syntax {

I would write this as `Some(Ok(match syntax { .. }))` as the last expression of this map. Then instead of `res.extend()` and `res.push()` you just return the vecs.

> filepatterns.rs:525
> +                    p
> +                })
> +            })?,

How about:

  if !p.is_empty() {
    p.push(b'/');
  }
  Ok(p)

REPOSITORY
  rHG Mercurial

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

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

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


More information about the Mercurial-devel mailing list