Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed Jul 24, 2024
1 parent 4c6d9d2 commit 32b71a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/shims/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 32b71a3

Please sign in to comment.