diff --git a/crates/pi-natives/src/file_lock/linux.rs b/crates/pi-natives/src/file_lock/linux.rs index 5ae538d5f..c7d75b5e0 100644 --- a/crates/pi-natives/src/file_lock/linux.rs +++ b/crates/pi-natives/src/file_lock/linux.rs @@ -22,6 +22,7 @@ pub fn try_acquire(path: &str) -> io::Result> { } impl PlatformFileLock { + #[allow(clippy::unnecessary_wraps, reason = "uniform cross-platform interface")] pub fn release(&mut self) -> io::Result<()> { drop(self.socket.take()); Ok(()) diff --git a/crates/pi-natives/src/file_lock/mod.rs b/crates/pi-natives/src/file_lock/mod.rs index 43e622762..a25d6fb4e 100644 --- a/crates/pi-natives/src/file_lock/mod.rs +++ b/crates/pi-natives/src/file_lock/mod.rs @@ -57,6 +57,7 @@ impl FileLock { /// Whether this handle owns the requested lock. #[napi(getter)] + #[allow(clippy::missing_const_for_fn, reason = "napi method signature")] pub fn acquired(&self) -> bool { self.inner.is_some() } diff --git a/crates/pi-natives/src/file_lock/unix.rs b/crates/pi-natives/src/file_lock/unix.rs index da449802d..da201efc4 100644 --- a/crates/pi-natives/src/file_lock/unix.rs +++ b/crates/pi-natives/src/file_lock/unix.rs @@ -14,6 +14,7 @@ pub fn try_acquire(path: &str) -> io::Result> { .read(true) .write(true) .create(true) + .truncate(false) .mode(0o600) .open(path)?; // SAFETY: `file` owns a live descriptor for the duration of this call. The @@ -31,6 +32,7 @@ pub fn try_acquire(path: &str) -> io::Result> { } impl PlatformFileLock { + #[allow(clippy::unnecessary_wraps, reason = "uniform cross-platform interface")] pub fn release(&mut self) -> io::Result<()> { drop(self.file.take()); Ok(())