fix new lints; clippy::unnecessary-map-or

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-11-28 23:33:33 +00:00
parent 2a9bb1ce11
commit 58be22e695
9 changed files with 10 additions and 17 deletions

View file

@ -54,7 +54,7 @@ impl LogLevelReloadHandles {
.lock()
.expect("locked")
.iter()
.filter(|(name, _)| names.map_or(false, |names| names.contains(&name.as_str())))
.filter(|(name, _)| names.is_some_and(|names| names.contains(&name.as_str())))
.for_each(|(_, handle)| {
_ = handle.reload(new_value.clone()).or_else(error::else_log);
});

View file

@ -58,8 +58,5 @@ pub unsafe fn current_exe() -> Result<std::path::PathBuf> {
/// accurate on all platforms; defaults to false.
#[must_use]
pub fn current_exe_deleted() -> bool {
std::env::current_exe().map_or(false, |exe| {
exe.to_str()
.map_or(false, |exe| exe.ends_with(" (deleted)"))
})
std::env::current_exe().is_ok_and(|exe| exe.to_str().is_some_and(|exe| exe.ends_with(" (deleted)")))
}