chore: clippy

This commit is contained in:
can1357
2026-08-03 16:43:59 +02:00
parent f948c61256
commit 74c346623b
3 changed files with 4 additions and 0 deletions
+1
View File
@@ -22,6 +22,7 @@ pub fn try_acquire(path: &str) -> io::Result<Option<PlatformFileLock>> {
}
impl PlatformFileLock {
#[allow(clippy::unnecessary_wraps, reason = "uniform cross-platform interface")]
pub fn release(&mut self) -> io::Result<()> {
drop(self.socket.take());
Ok(())
+1
View File
@@ -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()
}
+2
View File
@@ -14,6 +14,7 @@ pub fn try_acquire(path: &str) -> io::Result<Option<PlatformFileLock>> {
.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<Option<PlatformFileLock>> {
}
impl PlatformFileLock {
#[allow(clippy::unnecessary_wraps, reason = "uniform cross-platform interface")]
pub fn release(&mut self) -> io::Result<()> {
drop(self.file.take());
Ok(())