From 32b71a3ecbf39a3297c9ef97948a9b2e0a72db5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Wed, 24 Jul 2024 17:28:55 +0300 Subject: [PATCH] update --- src/shims/unix/fs.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shims/unix/fs.rs b/src/shims/unix/fs.rs index a4439e21c5..d1b07f8807 100644 --- a/src/shims/unix/fs.rs +++ b/src/shims/unix/fs.rs @@ -143,11 +143,11 @@ impl FileDescription for FileHandle { TRUE => Ok(()), FALSE => { let mut err = io::Error::last_os_error(); - let code = err.raw_os_error().and_then(u32::try_from).unwrap(); + let code: u32 = err.raw_os_error().unwrap().try_into().unwrap(); // Replace error with a custom WouldBlock error, which later will be mapped - // in the `helpers.rs` + // in the `helpers` module if lock_nb && matches!(code, ERROR_IO_PENDING | ERROR_LOCK_VIOLATION) { - let desc = format!("flock wouldblock error: {err}"); + let desc = format!("LockFileEx wouldblock error: {err}"); err = io::Error::new(io::ErrorKind::WouldBlock, desc); } Err(err)