Skip to content

Commit f490f80

Browse files
committed
rename no longer uses io::ErrorKind::Other
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
1 parent 66b0120 commit f490f80

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

crates/cargo-lambda-metadata/src/fs/rename_linux.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,13 @@ where
3737
{
3838
match fs::rename(&from, &to) {
3939
Ok(ok) => Ok(ok),
40-
Err(e) => match e.kind() {
41-
io::ErrorKind::Other if Some(libc::EXDEV) == e.raw_os_error() => {
42-
match copy_and_delete(from, to) {
43-
Ok(()) => Ok(()),
44-
Err(_) => Err(e),
45-
}
40+
Err(e) if Some(libc::EXDEV) == e.raw_os_error() => {
41+
match copy_and_delete(from, to) {
42+
Ok(()) => Ok(()),
43+
Err(_) => Err(e),
4644
}
47-
_ => Err(e),
4845
},
46+
Err(e) => Err(e),
4947
}
5048
}
5149

0 commit comments

Comments
 (0)