Skip to content

Commit e326036

Browse files
committed
fix: Improve code formatting for readability in safe_remove_dir_recursive_impl and safe_traversal modules
1 parent 29a04c0 commit e326036

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/uu/rm/src/platform/unix.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,8 @@ pub fn safe_remove_dir_recursive_impl(path: &Path, dir_fd: &DirFd, options: &Opt
376376
};
377377

378378
// Check if it's a directory
379-
let is_dir = (entry_stat.st_mode & libc::S_IFMT as libc::mode_t) == libc::S_IFDIR as libc::mode_t;
379+
let is_dir =
380+
(entry_stat.st_mode & libc::S_IFMT as libc::mode_t) == libc::S_IFDIR as libc::mode_t;
380381

381382
if is_dir {
382383
// Ask user if they want to descend into this directory

src/uucore/src/lib/features/safe_traversal.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ fn read_dir_entries(fd: &OwnedFd) -> io::Result<Vec<OsString>> {
105105
#[cfg(target_os = "redox")]
106106
{
107107
// Redox: directory traversal not implemented
108-
return Err(io::Error::new(io::ErrorKind::Other, "safe_traversal is not supported on Redox"));
108+
return Err(io::Error::new(
109+
io::ErrorKind::Other,
110+
"safe_traversal is not supported on Redox",
111+
));
109112
}
110113

111114
Ok(entries)
@@ -132,7 +135,10 @@ impl DirFd {
132135
}
133136
#[cfg(target_os = "redox")]
134137
{
135-
Err(io::Error::new(io::ErrorKind::Other, "safe_traversal is not supported on Redox"))
138+
Err(io::Error::new(
139+
io::ErrorKind::Other,
140+
"safe_traversal is not supported on Redox",
141+
))
136142
}
137143
}
138144

@@ -153,7 +159,10 @@ impl DirFd {
153159
}
154160
#[cfg(target_os = "redox")]
155161
{
156-
Err(io::Error::new(io::ErrorKind::Other, "safe_traversal is not supported on Redox"))
162+
Err(io::Error::new(
163+
io::ErrorKind::Other,
164+
"safe_traversal is not supported on Redox",
165+
))
157166
}
158167
}
159168

0 commit comments

Comments
 (0)