fix new lints; clippy::unnecessary-map-or
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
2a9bb1ce11
commit
58be22e695
9 changed files with 10 additions and 17 deletions
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -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)")))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue