chore: kernel: make clippy happy

This commit is contained in:
Paul Pan 2024-08-23 10:02:01 +08:00
parent c2d4e3d129
commit 607c4dc0c6
4 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@ impl ConsoleDevice for EarlyConsole {
unsafe { uart.write_volatile(ch) } unsafe { uart.write_volatile(ch) }
} }
fn write_str(&mut self, s: &str) -> () { fn write_str(&mut self, s: &str) {
for ch in s.bytes() { for ch in s.bytes() {
self.write(ch); self.write(ch);
} }

View File

@ -172,7 +172,7 @@ impl ConsoleDevice for UartSifive {
self.tx_write(n); self.tx_write(n);
} }
fn write_str(&mut self, s: &str) -> () { fn write_str(&mut self, s: &str) {
for ch in s.bytes() { for ch in s.bytes() {
self.write(ch); self.write(ch);
} }

View File

@ -41,7 +41,7 @@ impl ConsoleDevice for Uart16550 {
self.port.send(byte); self.port.send(byte);
} }
fn write_str(&mut self, s: &str) -> () { fn write_str(&mut self, s: &str) {
self.port.write_str(s).unwrap() self.port.write_str(s).unwrap()
} }
} }

View File

@ -38,7 +38,7 @@ impl ConsoleDevice for SilenceConsole {
fn write(&mut self, _: u8) {} fn write(&mut self, _: u8) {}
fn write_str(&mut self, _: &str) -> () {} fn write_str(&mut self, _: &str) {}
} }
pub static CONSOLE: Mutex<ConsoleDriver> = Mutex::new(ConsoleDriver::SilenceConsole(SilenceConsole)); pub static CONSOLE: Mutex<ConsoleDriver> = Mutex::new(ConsoleDriver::SilenceConsole(SilenceConsole));