Obeyed clippy, our paperclip overlord (mostly)

master
ondra05 2022-04-11 23:07:01 +02:00
parent bbc76766ae
commit c61cb9e24a
6 changed files with 45 additions and 4 deletions

View File

@ -26,8 +26,7 @@ pub struct KernelConfig {
impl KernelConfig {
pub fn new() -> Self {
let p: KernelConfig = toml::from_str(include_str!("../assets/kernel.toml")).unwrap();
p
toml::from_str(include_str!("../assets/kernel.toml")).unwrap()
}
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)]
pub struct LoggingConfig {
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>> =
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 {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
dump!(self, f, "VersionInformation", {
@ -921,6 +927,12 @@ impl Master {
delegate_flag!(time_stamp_counter, { invariant_tsc });
}
impl Default for Master {
fn default() -> Self {
Self::new()
}
}
/*
cfg_if! {
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 {
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()
}
}