diff --git a/komorebi/src/main.rs b/komorebi/src/main.rs index d96aa1072..078269dc6 100644 --- a/komorebi/src/main.rs +++ b/komorebi/src/main.rs @@ -509,16 +509,17 @@ fn main() -> Result<()> { Hidden::create("komorebi-hidden")?; - let static_config = if let Some(config) = opts.config { - Option::from(config) - } else { - let komorebi_json = HOME_DIR.join("komorebi.json"); - if komorebi_json.is_file() { - Option::from(komorebi_json) - } else { - None - } - }; + let static_config = opts.config.map_or_else( + || { + let komorebi_json = HOME_DIR.join("komorebi.json"); + if komorebi_json.is_file() { + Option::from(komorebi_json) + } else { + None + } + }, + Option::from, + ); let wm = if let Some(config) = &static_config { tracing::info!( diff --git a/komorebi/src/windows_api.rs b/komorebi/src/windows_api.rs index 57528456b..a5d4a2091 100644 --- a/komorebi/src/windows_api.rs +++ b/komorebi/src/windows_api.rs @@ -700,7 +700,7 @@ impl WindowsApi { Self::system_parameters_info_w( SPI_SETFOREGROUNDLOCKTIMEOUT, 0, - 0 as *mut c_void, + std::ptr::null_mut::(), SPIF_SENDCHANGE, )?;