Page MenuHomePhabricator

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

Authored by Alphare on Fri, Nov 29, 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.Fri, Nov 29, 12:56 PM
kevincox requested changes to this revision.Mon, Dec 2, 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.Mon, Dec 2, 8:04 AM
Alphare marked an inline comment as done.Mon, Dec 2, 9:20 AM
Alphare updated this revision to Diff 18421.
kevincox accepted this revision.Mon, Dec 2, 10:24 AM
pulkit accepted this revision.Tue, Dec 10, 10:09 AM
This revision is now accepted and ready to land.Tue, Dec 10, 10:09 AM