pretty-hex
pretty-hex copied to clipboard
hex_conf address showing too many zeroes
hex_conf is showing too many zeroes when at the end of a u16 range.
#[test]
fn test() {
let hex_config = HexConfig {
title: false,
display_offset: 0xfff0,
ascii: false,
..Default::default()
};
assert_eq!(
"fff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00",
format!("{buffer:?}", buffer = [0; 16].hex_conf(hex_config))
);
}
assertion `left == right` failed
left: "fff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"
right: "00fff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"