Skip to content

Commit

Permalink
Fix RUSTUP_PERMIT_COPY_RENAME condition so it is actually used
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dylanahsmith committed Mar 28, 2023
1 parent f78aa86 commit a9589c7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/utils/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(()),
Expand Down

0 comments on commit a9589c7

Please sign in to comment.