diff --git a/src/kernel/clock/time.rs b/src/kernel/clock/time.rs index 29f86bd..a2eea96 100644 --- a/src/kernel/clock/time.rs +++ b/src/kernel/clock/time.rs @@ -1,8 +1,6 @@ use core::{cmp::Ordering, ops::Sub, time::Duration}; -use alloc::string::ToString; - -use crate::format; +use alloc::{format, string::ToString}; extern "C" { fn system_time_get() -> usize; diff --git a/src/libk/string/format/mod.rs b/src/libk/string/format/mod.rs deleted file mode 100644 index 8d63056..0000000 --- a/src/libk/string/format/mod.rs +++ /dev/null @@ -1,38 +0,0 @@ -use alloc::string::{String, ToString}; - -#[macro_export] -macro_rules! format { - ( $s : expr, $( $e : expr ),* ) => {{ - use crate::libk::string::format::Format; - let mut res = $s.to_string(); - $( - res.format($e); - )* - res - }}; - () => {}; -} - -pub trait Format { - fn format(&mut self, f: T); -} - -impl Format for String { - fn format(&mut self, f: T) { - let mut res = String::new(); - let mut formatting = false; - for c in self.chars().into_iter() { - if c == '{' { - formatting = true; - res += &f.to_string(); - } else if c == '}' { - formatting = false; - } - if !formatting { - res.push(c); - } - } - self.clear(); - self.push_str(&res); - } -} diff --git a/src/libk/string/mod.rs b/src/libk/string/mod.rs index db7b59d..e69de29 100644 --- a/src/libk/string/mod.rs +++ b/src/libk/string/mod.rs @@ -1 +0,0 @@ -pub mod format;