Skip to content

Commit

Permalink
bootstrap: std::io::ErrorKind::CrossesDevices is finally stable
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigorenkoPV committed Jan 9, 2025
1 parent 251206c commit 4ba139d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/bootstrap/src/utils/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,7 @@ pub fn symlink_dir(config: &Config, original: &Path, link: &Path) -> io::Result<
/// copy and remove the file otherwise
pub fn move_file<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<()> {
match fs::rename(&from, &to) {
// FIXME: Once `ErrorKind::CrossesDevices` is stabilized use
// if e.kind() == io::ErrorKind::CrossesDevices {
#[cfg(unix)]
Err(e) if e.raw_os_error() == Some(libc::EXDEV) => {
Err(e) if e.kind() == io::ErrorKind::CrossesDevices => {
std::fs::copy(&from, &to)?;
std::fs::remove_file(&from)
}
Expand Down

0 comments on commit 4ba139d

Please sign in to comment.