-
How do I do something like
Ideally it should be stored as a number (without bulky allocations) and formatted as hex, just like |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can use It might be worthwhile to add helper functions to |
Beta Was this translation helpful? Give feedback.
You can use
format_args!("{:p}", ...)
as a normalDebug
orDisplay
field. Theformat_args!
macro produces a type which borrows the arguments and implementsDebug
andDisplay
, rather than allocating and producing aString
, likeformat!
.It might be worthwhile to add helper functions to
tracing::field
for producingdyn Display
s that format something usingfmt::Poitner
,fmt::UpperHex
/fmt::LowerHex
, and other formatting traits. But, in the meantime, usingformat_args!
should work.