From 88f88e51cc54c8f53dc7d24d59d84508cf1c5fb1 Mon Sep 17 00:00:00 2001 From: tommady Date: Wed, 4 Oct 2023 07:12:25 +0000 Subject: [PATCH] fix expected , found and spelling errors --- src/uu/cp/src/cp.rs | 8 +++++--- tests/by-util/test_cp.rs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/uu/cp/src/cp.rs b/src/uu/cp/src/cp.rs index 285a696a9..fc6332f3b 100644 --- a/src/uu/cp/src/cp.rs +++ b/src/uu/cp/src/cp.rs @@ -2,7 +2,7 @@ // // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -// spell-checker:ignore (ToDO) copydir ficlone fiemap ftruncate linkgs lstat nlink nlinks pathbuf pwrite reflink strs xattrs symlinked deduplicated advcpmv nushell +// spell-checker:ignore (ToDO) copydir ficlone fiemap ftruncate linkgs lstat nlink nlinks pathbuf pwrite reflink strs xattrs symlinked deduplicated advcpmv nushell IRWXG IRWXO IRWXU IRWXUGO IRWXU IRWXG IRWXO IRWXUGO #![allow(clippy::missing_safety_doc)] #![allow(clippy::extra_unused_lifetimes)] @@ -1057,6 +1057,7 @@ impl Options { } } + #[cfg(unix)] fn preserve_mode(&self) -> (bool, bool) { match self.attributes.mode { Preserve::No { explicit } => match explicit { @@ -1754,8 +1755,9 @@ fn copy_file( use libc::{ S_IRGRP, S_IROTH, S_IRUSR, S_IRWXG, S_IRWXO, S_IRWXU, S_IWGRP, S_IWOTH, S_IWUSR, }; - const MODE_RW_UGO: u32 = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; - const S_IRWXUGO: u32 = S_IRWXU | S_IRWXG | S_IRWXO; + const MODE_RW_UGO: u32 = + (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) as u32; + const S_IRWXUGO: u32 = (S_IRWXU | S_IRWXG | S_IRWXO) as u32; match is_explicit_no_preserve_mode { true => mode = MODE_RW_UGO, diff --git a/tests/by-util/test_cp.rs b/tests/by-util/test_cp.rs index f6d339a7e..95d130f88 100644 --- a/tests/by-util/test_cp.rs +++ b/tests/by-util/test_cp.rs @@ -2,7 +2,7 @@ // // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -// spell-checker:ignore (flags) reflink (fs) tmpfs (linux) rlimit Rlim NOFILE clob btrfs ROOTDIR USERDIR procfs outfile +// spell-checker:ignore (flags) reflink (fs) tmpfs (linux) rlimit Rlim NOFILE clob btrfs ROOTDIR USERDIR procfs outfile uufs use crate::common::util::TestScenario; #[cfg(not(windows))]