Skip to content

Commit

Permalink
rename no longer uses io::ErrorKind::Other
Browse files Browse the repository at this point in the history
io::ErrorKind::Other no longer gets returned by std as of rust-lang/rust#85746
In lieu of requiring the io_error_more feature, match against the raw_os_error directly

Fixes cargo-lambda#70
  • Loading branch information
sdd committed Apr 18, 2022
1 parent 66b0120 commit f490f80
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions crates/cargo-lambda-metadata/src/fs/rename_linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,13 @@ where
{
match fs::rename(&from, &to) {
Ok(ok) => Ok(ok),
Err(e) => match e.kind() {
io::ErrorKind::Other if Some(libc::EXDEV) == e.raw_os_error() => {
match copy_and_delete(from, to) {
Ok(()) => Ok(()),
Err(_) => Err(e),
}
Err(e) if Some(libc::EXDEV) == e.raw_os_error() => {
match copy_and_delete(from, to) {
Ok(()) => Ok(()),
Err(_) => Err(e),
}
_ => Err(e),
},
Err(e) => Err(e),
}
}

Expand Down

0 comments on commit f490f80

Please sign in to comment.