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)