diff --git a/src/lib.rs b/src/lib.rs index 1cd60a46..8be4c8b4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,7 +13,7 @@ // limitations under the License. #![feature(no_std, lang_items)] -#![feature(const_fn, unique)] +#![feature(const_fn, unique, core_str_ext)] #![no_std] extern crate rlibc; diff --git a/src/vga_buffer.rs b/src/vga_buffer.rs index d70e1859..e044d211 100644 --- a/src/vga_buffer.rs +++ b/src/vga_buffer.rs @@ -1,4 +1,5 @@ use core::ptr::Unique; +use core::fmt; use spin::Mutex; const BUFFER_HEIGHT: usize = 25; @@ -78,6 +79,15 @@ impl Writer { } } +impl fmt::Write for Writer { + fn write_str(&mut self, s: &str) -> ::core::fmt::Result { + for byte in s.bytes() { + self.write_byte(byte) + } + Ok(()) + } +} + #[derive(Clone, Copy)] struct ColorCode(u8);