Skip to content

Commit 0e17869

Browse files
authored
update rustix (#336)
* update rustix * use renamat_with on apple operating systems
1 parent 6cf6536 commit 0e17869

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ once_cell = { version = "1.19.0", default-features = false, features = ["std"] }
2626
getrandom = { version = "0.3.0", default-features = false, optional = true }
2727

2828
[target.'cfg(any(unix, target_os = "wasi"))'.dependencies]
29-
rustix = { version = "0.38.39", features = ["fs"] }
29+
rustix = { version = "1.0.0", features = ["fs"] }
3030

3131
[target.'cfg(windows)'.dependencies.windows-sys]
3232
version = ">=0.52,<0.60"

src/file/imp/unix.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,17 @@ pub fn persist(old_path: &Path, new_path: &Path, overwrite: bool) -> io::Result<
113113
if overwrite {
114114
rename(old_path, new_path)?;
115115
} else {
116-
// On Linux, use `renameat_with` to avoid overwriting an existing name,
117-
// if the kernel and the filesystem support it.
118-
#[cfg(any(target_os = "android", target_os = "linux"))]
116+
// On Linux and apple operating systems, use `renameat_with` to avoid overwriting an
117+
// existing name, if the kernel and the filesystem support it.
118+
#[cfg(any(
119+
target_os = "android",
120+
target_os = "linux",
121+
target_os = "macos",
122+
target_os = "ios",
123+
target_os = "tvos",
124+
target_os = "visionos",
125+
target_os = "watchos",
126+
))]
119127
{
120128
use rustix::fs::{renameat_with, RenameFlags, CWD};
121129
use rustix::io::Errno;

0 commit comments

Comments
 (0)