From 158d1d2db04d715cc994ed2907deaff4ec181768 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 22 Feb 2025 21:04:30 +1100 Subject: [PATCH] Fix fs-lock error on nightly Since File::*lock* API is stablised on 1.87, it overrides fs4::fs_std::FileExt Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- crates/fs-lock/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/fs-lock/src/lib.rs b/crates/fs-lock/src/lib.rs index 0a96609f..5cd81d22 100644 --- a/crates/fs-lock/src/lib.rs +++ b/crates/fs-lock/src/lib.rs @@ -32,7 +32,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 file.try_lock_exclusive() { + match FileExt::try_lock_exclusive(&file) { Ok(()) => Ok(Self(file)), Err(e) if e.raw_os_error() == fs4::lock_contended_error().raw_os_error() => { Err((file, None))