Fix multiple Default implementation caveats

This commit is contained in:
Zhang Junyang
2024-06-20 16:04:01 +00:00
committed by Tate, Hongliang Tian
parent 8633893bb9
commit d6714c4b47
7 changed files with 35 additions and 6 deletions

View File

@ -73,6 +73,12 @@ impl TtyDriver {
}
}
impl Default for TtyDriver {
fn default() -> Self {
Self::new()
}
}
fn console_input_callback(mut reader: VmReader) {
let tty_driver = get_tty_driver();
while reader.remain() > 0 {

View File

@ -85,3 +85,9 @@ impl<E: Events, F: EventsFilter<E>> Subject<E, F> {
});
}
}
impl<E: Events> Default for Subject<E> {
fn default() -> Self {
Self::new()
}
}

View File

@ -198,6 +198,12 @@ impl FileTable {
}
}
impl Default for FileTable {
fn default() -> Self {
Self::new()
}
}
impl Clone for FileTable {
fn clone(&self) -> Self {
Self {

View File

@ -97,3 +97,9 @@ impl Clone for Heap {
}
}
}
impl Default for Heap {
fn default() -> Self {
Self::new()
}
}