summaryrefslogtreecommitdiffstats
path: root/src/utils.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.rs')
-rw-r--r--src/utils.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/utils.rs b/src/utils.rs
index 5a18948..76f2b8f 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -1,8 +1,15 @@
use chrono::prelude::*;
use std::io::{stdout, Write};
-pub fn dump<T: ToString>(text: T, newlines: usize) {
- print!("{}{}", text.to_string(), "\n".repeat(newlines));
+#[macro_export]
+macro_rules! print_now {
+ ($($arg:tt)*) => {
+ $crate::utils::print_now(&format!($($arg)*))
+ };
+}
+
+pub fn print_now<T: ToString>(text: T) {
+ print!("{}", text.to_string());
let _ = stdout().flush();
}