mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-30 09:05:54 +00:00
Remove additional space found on short input
This commit is contained in:
1 parent
175847787d
commit
23f199ffbd
1 file changed
+2
-2
+2
-2
@@ -340,7 +340,7 @@ impl<'a, Writer: Write> Printer<'a, Writer> {
|
|||||||
if len < 8 {
|
if len < 8 {
|
||||||
let _ = writeln!(
|
let _ = writeln!(
|
||||||
&mut self.buffer_line,
|
&mut self.buffer_line,
|
||||||
"{0:1$}{3}{0:2$}{4} ",
|
"{0:1$}{3}{0:2$}{4}",
|
||||||
"",
|
"",
|
||||||
8 - len,
|
8 - len,
|
||||||
8,
|
8,
|
||||||
@@ -466,7 +466,7 @@ mod tests {
|
|||||||
fn short_input_passes() {
|
fn short_input_passes() {
|
||||||
let input = io::Cursor::new(b"spam");
|
let input = io::Cursor::new(b"spam");
|
||||||
let expected_string = "┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
|
let expected_string = "┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
|
||||||
│00000000│ 73 70 61 6d ┊ │spam ┊ │
|
│00000000│ 73 70 61 6d ┊ │spam ┊ │
|
||||||
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘
|
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘
|
||||||
".to_owned();
|
".to_owned();
|
||||||
assert_print_all_output(input, expected_string);
|
assert_print_all_output(input, expected_string);
|
||||||
|
|||||||
Reference in new issue
Block a user