D6766: rustfilepatterns: refactor the pattern of removing a prefix from a &[u8]

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


kevincox added inline comments.
kevincox accepted this revision.

INLINE COMMENTS

> utils.rs:44
>      fn trim(&self) -> &Self;
> +    fn chop_prefix(&self, needle:&Self) -> Option<&Self>;
>  }

I have a small preference for `drop_prefix`.

> utils.rs:44
>      fn trim(&self) -> &Self;
> +    fn chop_prefix(&self, needle:&Self) -> Option<&Self>;
>  }

Put a space in `needle: &Self`

> utils.rs:86
> +
> +    fn chop_prefix(&self, needle:&Self) -> Option<&Self> {
> +        if self.starts_with(needle) {

Put a space in needle: &Self

REPOSITORY
  rHG Mercurial

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

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

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


More information about the Mercurial-devel mailing list