chore: clippy
This commit is contained in:
@@ -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(())
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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(())
|
||||
|
||||
Reference in New Issue
Block a user