cap_primitives/rustix/fs/rename_unchecked.rs
1use rustix::fs::renameat;
2use std::path::Path;
3use std::{fs, io};
4
5/// *Unsandboxed* function similar to `rename`, but which does not perform
6/// sandboxing.
7pub(crate) fn rename_unchecked(
8 old_start: &fs::File,
9 old_path: &Path,
10 new_start: &fs::File,
11 new_path: &Path,
12) -> io::Result<()> {
13 Ok(renameat(old_start, old_path, new_start, new_path)?)
14}