KokaKiwi / rust-hex

A basic crate to encode values to hexadecimal representation. Originally extracted from rustc-serialize.
https://crates.io/crates/hex
Apache License 2.0
201 stars 55 forks source link

Introduce hex::display for Display’ing binary data in hex #78

Open mina86 opened 1 year ago

mina86 commented 1 year ago

encode method allocates a new string which is wasteful if all one wants to do is display the binary data using format! or related macro.

Introduce hex::Display wrapper with hex::display as its constructor which wraps the binary data in an object that implements Display, LowerHex, UpperHex and Debug and formats the data as hex. However, as it uses buffers on stack, it performs no allocations.

mina86 commented 10 months ago

@KokaKiwi, friendly ping.