Update from previous chapters.

This commit is contained in:
Yifan Wu 2021-01-06 00:19:10 +08:00
parent 3851c2d561
commit c33c0f8aea
7 changed files with 31 additions and 21 deletions

View file

@ -1,11 +1,13 @@
use core::fmt::{self, Write};
use crate::syscall::{STDOUT, sys_write};
use super::write;
struct Stdout;
const STDOUT: usize = 1;
impl Write for Stdout {
fn write_str(&mut self, s: &str) -> fmt::Result {
sys_write(STDOUT, s.as_bytes());
write(STDOUT, s.as_bytes());
Ok(())
}
}