Skip to content

Commit c8cc10c

Browse files
committed
fix: Use type inference for mode checks in prompt_file_with_stat and safe_remove_dir_recursive_impl
1 parent ee18c58 commit c8cc10c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fn prompt_file_with_stat(path: &Path, stat: &libc::stat, options: &Options) -> b
4242
return true;
4343
}
4444

45-
let is_symlink = (stat.st_mode & (libc::S_IFMT as u16)) == (libc::S_IFLNK as u16);
45+
let is_symlink = (stat.st_mode & (libc::S_IFMT as _)) == (libc::S_IFLNK as _);
4646
let writable = mode_writable(stat.st_mode as libc::mode_t);
4747
let len = stat.st_size as u64;
4848
let stdin_ok = options.__presume_input_tty.unwrap_or(false) || stdin().is_terminal();
@@ -377,7 +377,7 @@ pub fn safe_remove_dir_recursive_impl(path: &Path, dir_fd: &DirFd, options: &Opt
377377

378378
// Check if it's a directory
379379
let is_dir =
380-
(entry_stat.st_mode & (libc::S_IFMT as u16)) == (libc::S_IFDIR as u16);
380+
(entry_stat.st_mode & (libc::S_IFMT as _)) == (libc::S_IFDIR as _);
381381

382382
if is_dir {
383383
// Ask user if they want to descend into this directory

0 commit comments

Comments
 (0)