add fmt.rs

This commit is contained in:
Sandipsinh Rathod 2024-11-17 22:31:09 -05:00
parent 2a8251a693
commit 6f05ac8df1
3 changed files with 5 additions and 1 deletions

3
src/fmt.rs Normal file

@ -0,0 +1,3 @@
pub fn print<T: AsRef<str>>(t: T) {
println!("{}", t.as_ref());
}

@ -2,4 +2,5 @@ pub mod cpgen;
pub mod lang;
pub mod r#static;
pub(crate) mod fmt;
pub mod runner;

@ -63,7 +63,7 @@ impl Runner {
String::from_utf8(output.stderr)?
));
}
println!("{}", String::from_utf8(output.stdout)?);
crate::fmt::print(String::from_utf8(output.stdout)?);
}
};