From c836f0026a75938282d906b71e2fde0a4d91fc21 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 1 Mar 2025 17:48:32 +1100 Subject: [PATCH] Fix use of fs4::fs_std::FileExt::try_lock* Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- crates/fs-lock/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/fs-lock/src/lib.rs b/crates/fs-lock/src/lib.rs index abf60873..f3c8ac8a 100644 --- a/crates/fs-lock/src/lib.rs +++ b/crates/fs-lock/src/lib.rs @@ -44,7 +44,7 @@ impl FileLock { /// Note that this operation is blocking, and should not be called in async contexts. pub fn new_try_exclusive(file: File) -> Result)> { match FileExt::try_lock_exclusive(&file) { - Ok(()) => Ok(Self::new(file)), + Ok(_) => Ok(Self::new(file)), Err(e) if e.raw_os_error() == fs4::lock_contended_error().raw_os_error() => { Err((file, None)) } @@ -70,7 +70,7 @@ impl FileLock { /// Note that this operation is blocking, and should not be called in async contexts. pub fn new_try_shared(file: File) -> Result)> { match FileExt::try_lock_shared(&file) { - Ok(()) => Ok(Self::new(file)), + Ok(_) => Ok(Self::new(file)), Err(e) if e.raw_os_error() == fs4::lock_contended_error().raw_os_error() => { Err((file, None)) }