Write trait
This commit is contained in:
parent
65c824e104
commit
00e97bbd24
@ -1,4 +1,6 @@
|
||||
use volatile::Volatile;
|
||||
use core::fmt;
|
||||
use core::fmt::Write;
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
@ -86,13 +88,18 @@ impl Writer {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Write for Writer {
|
||||
fn write_str(&mut self, s: &str) -> fmt::Result {
|
||||
self.write_string(s);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
pub fn yolo() {
|
||||
let mut writer = Writer {
|
||||
column_position: 0, color_code: ColorCode::new(Color::Yellow, Color::Black),
|
||||
buffer: unsafe { &mut *(0xb8000 as *mut Buffer) },
|
||||
};
|
||||
|
||||
writer.write_string("Gamarjoba, munde\n");
|
||||
writer.write_string("Hella bro");
|
||||
writer.write_string("sore は");
|
||||
write!(writer, "Gamarjoba munde {}", 34);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user