Obeyed clippy, our paperclip overlord (mostly)

This commit is contained in:
Erin 2022-04-11 23:07:01 +02:00 committed by ondra05
parent a258676d20
commit b86d42e48c
6 changed files with 45 additions and 4 deletions

View file

@ -26,8 +26,7 @@ pub struct KernelConfig {
impl KernelConfig { impl KernelConfig {
pub fn new() -> Self { pub fn new() -> Self {
let p: KernelConfig = toml::from_str(include_str!("../assets/kernel.toml")).unwrap(); toml::from_str(include_str!("../assets/kernel.toml")).unwrap()
p
} }
pub fn log_level(&self) -> LevelFilter { pub fn log_level(&self) -> LevelFilter {
@ -43,6 +42,12 @@ impl KernelConfig {
} }
} }
impl Default for KernelConfig {
fn default() -> Self {
Self::new()
}
}
#[derive(Serialize, Debug, Deserialize)] #[derive(Serialize, Debug, Deserialize)]
pub struct LoggingConfig { pub struct LoggingConfig {
pub enabled: bool, pub enabled: bool,

View file

@ -38,5 +38,11 @@ impl DeviceTable {
} }
} }
impl Default for DeviceTable {
fn default() -> Self {
Self::new()
}
}
pub static DEVICE_TABLE: Lazy<spin::Mutex<DeviceTable>> = pub static DEVICE_TABLE: Lazy<spin::Mutex<DeviceTable>> =
Lazy::new(|| spin::Mutex::new(DeviceTable::new())); Lazy::new(|| spin::Mutex::new(DeviceTable::new()));

View file

@ -286,6 +286,12 @@ impl VersionInformation {
}); });
} }
impl Default for VersionInformation {
fn default() -> Self {
Self::new()
}
}
impl fmt::Debug for VersionInformation { impl fmt::Debug for VersionInformation {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
dump!(self, f, "VersionInformation", { dump!(self, f, "VersionInformation", {
@ -921,6 +927,12 @@ impl Master {
delegate_flag!(time_stamp_counter, { invariant_tsc }); delegate_flag!(time_stamp_counter, { invariant_tsc });
} }
impl Default for Master {
fn default() -> Self {
Self::new()
}
}
/* /*
cfg_if! { cfg_if! {
if #[cfg(any(target_arch = "x86_64", target_arch = "x86"))] { if #[cfg(any(target_arch = "x86_64", target_arch = "x86"))] {

View file

@ -101,3 +101,9 @@ impl MailBoxes {
); );
} }
} }
impl Default for MailBoxes {
fn default() -> Self {
Self::new()
}
}

View file

@ -1,7 +1,13 @@
pub struct Compositor {} pub struct Compositor;
impl Compositor { impl Compositor {
pub fn new() -> Self { pub fn new() -> Self {
Self {} Self
}
}
impl Default for Compositor {
fn default() -> Self {
Self::new()
} }
} }

View file

@ -28,3 +28,9 @@ impl KernelInternalState {
} }
} }
} }
impl Default for KernelInternalState {
fn default() -> Self {
Self::new()
}
}