D7604: rust-hg-path: implement more readable custom Debug for HgPath{, Buf}

kevincox (Kevin Cox) phabricator at mercurial-scm.org
Wed Dec 11 12:57:35 EST 2019


kevincox added inline comments.
kevincox accepted this revision.

INLINE COMMENTS

> hg_path.rs:186
> +    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
> +        write!(f, "HgPath({})", String::from_utf8_lossy(&self.inner))
> +    }

I would recommend `"HgPath({:?})"` so that the result is unambiguous and nicely escaped.

REPOSITORY
  rHG Mercurial

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

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

To: martinvonz, #hg-reviewers, kevincox
Cc: durin42, kevincox, mercurial-devel


More information about the Mercurial-devel mailing list