mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-16 11:46:17 +00:00
refactor/pathchk ~ fix cargo clippy
complaint (clippy::needless_borrow)
This commit is contained in:
parent
b3dd80d39c
commit
02f35c8965
1 changed files with 6 additions and 6 deletions
|
@ -118,10 +118,10 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
// check a path, given as a slice of it's components and an operating mode
|
||||
fn check_path(mode: &Mode, path: &[String]) -> bool {
|
||||
match *mode {
|
||||
Mode::Basic => check_basic(&path),
|
||||
Mode::Extra => check_default(&path) && check_extra(&path),
|
||||
Mode::Both => check_basic(&path) && check_extra(&path),
|
||||
_ => check_default(&path),
|
||||
Mode::Basic => check_basic(path),
|
||||
Mode::Extra => check_default(path) && check_extra(path),
|
||||
Mode::Both => check_basic(path) && check_extra(path),
|
||||
_ => check_default(path),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -156,7 +156,7 @@ fn check_basic(path: &[String]) -> bool {
|
|||
);
|
||||
return false;
|
||||
}
|
||||
if !check_portable_chars(&p) {
|
||||
if !check_portable_chars(p) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ fn check_basic(path: &[String]) -> bool {
|
|||
fn check_extra(path: &[String]) -> bool {
|
||||
// components: leading hyphens
|
||||
for p in path {
|
||||
if !no_leading_hyphen(&p) {
|
||||
if !no_leading_hyphen(p) {
|
||||
writeln!(
|
||||
&mut std::io::stderr(),
|
||||
"leading hyphen in file name component '{}'",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue