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>
This commit is contained in:
Jiahao XU 2025-02-22 21:04:30 +11:00 committed by GitHub
parent ac0e34cc77
commit 158d1d2db0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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<Self, (File, Option<io::Error>)> {
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))