rust/rhg/src/commands/root.rs
changeset 45984 fada33872b5b
parent 45438 ed95ccc94333
child 46135 dca9cb99971c
--- a/rust/rhg/src/commands/root.rs	Mon Nov 30 10:18:36 2020 +0100
+++ b/rust/rhg/src/commands/root.rs	Thu Nov 26 09:54:16 2020 +0100
@@ -1,6 +1,7 @@
 use crate::commands::Command;
 use crate::error::CommandError;
 use crate::ui::Ui;
+use format_bytes::format_bytes;
 use hg::operations::FindRoot;
 use hg::utils::files::get_bytes_from_path;
 
@@ -24,8 +25,7 @@
 
         let bytes = get_bytes_from_path(path_buf);
 
-        // TODO use formating macro
-        ui.write_stdout(&[bytes.as_slice(), b"\n"].concat())?;
+        ui.write_stdout(&format_bytes!(b"{}\n", bytes.as_slice()))?;
 
         Ok(())
     }