From a9589c7295ebc28972482f8a715cbdd9a0173d53 Mon Sep 17 00:00:00 2001 From: Dylan Thacker-Smith Date: Tue, 28 Mar 2023 12:04:50 -0400 Subject: [PATCH] Fix RUSTUP_PERMIT_COPY_RENAME condition so it is actually used The addition of the experimental io::ErrorKind::CrossesDevices variant prevented the RUSTUP_PERMIT_COPY_RENAME condition on io::ErrorKind::Other from matching. This shows why it is a bad idea to explicitly match on io::ErrorKind::Other rather than using the default pattern and it doesn't seem like there was any need to do that anyways given the raw_os_error condition. --- src/utils/utils.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/utils/utils.rs b/src/utils/utils.rs index 2db3368bef..3a58ce4abf 100644 --- a/src/utils/utils.rs +++ b/src/utils/utils.rs @@ -622,9 +622,8 @@ where OperationResult::Retry(e) } #[cfg(target_os = "linux")] - io::ErrorKind::Other - if process().var_os("RUSTUP_PERMIT_COPY_RENAME").is_some() - && Some(EXDEV) == e.raw_os_error() => + _ if process().var_os("RUSTUP_PERMIT_COPY_RENAME").is_some() + && Some(EXDEV) == e.raw_os_error() => { match copy_and_delete(name, src, dest, notify_handler) { Ok(()) => OperationResult::Ok(()),