slicedisplay - lightweight Display
for Vecs and slices
slicedisplay
is a tiny no-std
crate which supplies the SliceDisplay
trait.
This trait extends AsRef<[T]>
with the display
method, which allows formatting without heap allocations.
Requires at least Rust 1.58.
Usage
use SliceDisplay;
let empty: = Vec new;
assert_eq!;
let single = Vec from;
assert_eq!;
let numbers = Vec from;
assert_eq!;
It's also possible to slightly customize the display.
use SliceDisplay;
let hello: = "Hello".chars.collect;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;