This is an archive of the discontinued Mercurial Phabricator instance.

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

Authored by martinvonz on Dec 11 2019, 12:51 PM.

Details

Summary

The default prints the vector of bytes as a list of integers. I
considered instead getting rid of the Debug trait, but we use the
Debug format in lots of derived Debug instances, so we probably do
want to implement it.

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

martinvonz created this revision.Dec 11 2019, 12:51 PM
kevincox accepted this revision.Dec 11 2019, 12:57 PM
kevincox added inline comments.
rust/hg-core/src/utils/hg_path.rs
186

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

martinvonz marked an inline comment as done.Dec 11 2019, 1:05 PM
martinvonz updated this revision to Diff 18618.
martinvonz added inline comments.Dec 11 2019, 1:05 PM
rust/hg-core/src/utils/hg_path.rs
186

Good point.

Alphare accepted this revision.Dec 11 2019, 2:28 PM
pulkit accepted this revision.Dec 17 2019, 3:56 AM
This revision is now accepted and ready to land.Dec 17 2019, 3:56 AM