Closed by commit rHG406bd21d363b: rustfilepatterns: shorter code for
concatenating slices (authored by valentin.gatienbaron).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs
Review".
REPOSITORY
valentin.gatienbaron added inline comments.
valentin.gatienbaron marked 2 inline comments as done.
INLINE COMMENTS
> kevincox wrote in filepatterns.rs:161
> For the other ones I think the problem is that it gets the element type from
> the first element as ``. I think a better approach then
valentin.gatienbaron updated this revision to Diff 16330.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D6765?vs=16328=16330
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D6765/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D6765
kevincox added inline comments.
INLINE COMMENTS
> valentin.gatienbaron wrote in filepatterns.rs:161
> Indeed, although it took a compiler upgrade.
> I don't really understand why the compiler accepts the change here but not in
> the other places. It seems a bit random to remove the borrow only
valentin.gatienbaron added inline comments.
INLINE COMMENTS
> kevincox wrote in filepatterns.rs:161
> I don't think you need the `&_[..]`. https://rust.godbolt.org/z/Wo-vza
Indeed, although it took a compiler upgrade.
I don't really understand why the compiler accepts the change here but not in
valentin.gatienbaron updated this revision to Diff 16328.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D6765?vs=16321=16328
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D6765/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D6765
kevincox added inline comments.
kevincox accepted this revision.
INLINE COMMENTS
> filepatterns.rs:161
> }
> -let mut res = b".*".to_vec();
> -res.extend(pattern);
> -res
> +[".*"[..], pattern].concat()
> }
I don't think you
valentin.gatienbaron updated this revision to Diff 16321.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D6765?vs=16318=16321
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D6765/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D6765
valentin.gatienbaron created this revision.
Herald added subscribers: mercurial-devel, kevincox, durin42.
Herald added a reviewer: hg-reviewers.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D6765
AFFECTED FILES
rust/hg-core/src/filepatterns.rs
CHANGE DETAILS