D6765: rustfilepatterns: shorter code for concatenating slices

kevincox (Kevin Cox) phabricator at mercurial-scm.org
Wed Aug 28 07:48:39 EDT 2019


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 here. What do you think about the next commit? It would remove the `&_[..]` more predictably.

For the other ones I think the problem is that it gets the element type from the first element as `&Vec<u8>`. I think a better approach then creating the wrapper function is doing `[vec.as_slice(), b"foobar"].concat()`.

REPOSITORY
  rHG Mercurial

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

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

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


More information about the Mercurial-devel mailing list