D7867: rust-hg-path: add useful methods to `HgPath`
kevincox (Kevin Cox)
phabricator at mercurial-scm.org
Thu Jan 16 10:51:39 EST 2020
This revision now requires changes to proceed.
kevincox added inline comments.
kevincox requested changes to this revision.
INLINE COMMENTS
> hg_path.rs:169
> + &mut self.inner
> + }
> pub fn contains(&self, other: u8) -> bool {
I don't think we should have this method. It provides us no way to ensure that the invariants of this type are upheld. It is slightly more typing but I think we should recommend converting to a slice, doing the mutation, then converting back to `HgPath` then we can at least to validation (possibly only in debug builds) in the constructor.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D7867/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D7867
To: Alphare, #hg-reviewers, kevincox
Cc: durin42, kevincox, mercurial-devel
More information about the Mercurial-devel
mailing list