Introduce SerialKind::NotPresent

This commit is contained in:
bjorn3
2025-09-12 19:32:19 +02:00
parent 2394db2dc5
commit 92e5397efa
9 changed files with 34 additions and 51 deletions
+2 -4
View File
@@ -3,7 +3,7 @@ use spin::MutexGuard;
use crate::{device::serial::COM1, devices::serial::SerialKind};
pub struct Writer<'a> {
serial: MutexGuard<'a, Option<SerialKind>>,
serial: MutexGuard<'a, SerialKind>,
}
impl<'a> Writer<'a> {
@@ -14,8 +14,6 @@ impl<'a> Writer<'a> {
}
pub fn write(&mut self, buf: &[u8]) {
if let Some(ref mut serial) = *self.serial {
serial.write(buf);
}
self.serial.write(buf);
}
}