Skip to content

Commit e14a784

Browse files
committed
fix(config): compare Windows lock owners on success
Avoid Result equality because std::io::Error is not comparable; only compare lock owner contents after a successful read.
1 parent 89be8d7 commit e14a784

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

crates/loopal-config/src/settings_file_lock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl Drop for SettingsFileLock {
8585
let _ = unsafe { libc::flock(self.file.as_raw_fd(), libc::LOCK_UN) };
8686
}
8787
#[cfg(not(unix))]
88-
if std::fs::read_to_string(&self.path).as_deref() == Ok(self.owner.as_str()) {
88+
if std::fs::read_to_string(&self.path).is_ok_and(|owner| owner == self.owner) {
8989
let _ = std::fs::remove_file(&self.path);
9090
}
9191
}

0 commit comments

Comments
 (0)