From cd6b773326887d2d81699f580e6aa57e69a59202 Mon Sep 17 00:00:00 2001 From: Paul Pan Date: Fri, 16 Feb 2024 18:16:03 +0800 Subject: [PATCH] chore: format console/log --- src/logging.rs | 3 +-- src/plat/io.rs | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/logging.rs b/src/logging.rs index f8f75ff..ce3533d 100644 --- a/src/logging.rs +++ b/src/logging.rs @@ -44,8 +44,7 @@ impl Log for SimpleLogger { } pub fn init() { - static LOGGER: SimpleLogger = SimpleLogger; - log::set_logger(&LOGGER).unwrap(); + log::set_logger(&SimpleLogger).unwrap(); // TODO: get log level from boot env log::set_max_level(LevelFilter::Trace); diff --git a/src/plat/io.rs b/src/plat/io.rs index ce3e283..75b62a5 100644 --- a/src/plat/io.rs +++ b/src/plat/io.rs @@ -1,15 +1,13 @@ pub struct RawConsole -where RawConsole: Printer; +where RawConsole: Printer + Reader; pub trait Printer: core::fmt::Write { fn put_char(c: char); - #[inline] fn put_str(s: &str) { s.chars().for_each(Self::put_char); } - #[inline] fn put_line(s: &str) { Self::put_str(s); Self::put_char('\n');