D6765: rustfilepatterns: shorter code for concatenating slices

kevincox (Kevin Cox) phabricator at mercurial-scm.org
Wed Aug 28 05:26:21 EDT 2019


kevincox added inline comments.
kevincox accepted this revision.

INLINE COMMENTS

> filepatterns.rs:161
>              }
> -            let mut res = b".*".to_vec();
> -            res.extend(pattern);
> -            res
> +            [&b".*"[..], pattern].concat()
>          }

I don't think you need the `&_[..]`. https://rust.godbolt.org/z/Wo-vza

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