This is an archive of the discontinued Mercurial Phabricator instance.

rust-hg-path: implement `Display` for `HgPath` and `HgPathBuf`
ClosedPublic

Authored by Alphare on Nov 29 2019, 12:56 PM.

Details

Summary

This is useful when debugging, to get a human readable output instead of an
array of u8.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Alphare created this revision.Nov 29 2019, 12:56 PM
kevincox requested changes to this revision.Dec 2 2019, 8:04 AM
kevincox added inline comments.
rust/hg-core/src/utils/hg_path.rs
168

This looks more like a Debug format than a Display format. For Display I would just do write!(f, "{}", String::from_utf8_lossy(&self.inner))`

This revision now requires changes to proceed.Dec 2 2019, 8:04 AM
Alphare marked an inline comment as done.Dec 2 2019, 9:20 AM
Alphare updated this revision to Diff 18421.
kevincox accepted this revision.Dec 2 2019, 10:24 AM
pulkit accepted this revision.Dec 10 2019, 10:09 AM
This revision is now accepted and ready to land.Dec 10 2019, 10:09 AM