1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00
This commit is contained in:
Terts Diepraam 2021-08-10 17:56:41 +02:00
parent ea3c15f0dd
commit 14459cf611
2 changed files with 9 additions and 6 deletions

View file

@ -107,10 +107,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
if recursive {
if bit_flag == FTS_PHYSICAL {
if derefer == 1 {
return Err(USimpleError::new(
1,
"-R --dereference requires -H or -L",
));
return Err(USimpleError::new(1, "-R --dereference requires -H or -L"));
}
derefer = 0;
}

View file

@ -279,7 +279,10 @@ pub struct USimpleError {
impl USimpleError {
#[allow(clippy::new_ret_no_self)]
pub fn new<S: Into<String>>(code: i32, message: S) -> Box<dyn UError> {
Box::new(Self { code, message: message.into() })
Box::new(Self {
code,
message: message.into(),
})
}
}
@ -306,7 +309,10 @@ pub struct UUsageError {
impl UUsageError {
#[allow(clippy::new_ret_no_self)]
pub fn new<S: Into<String>>(code: i32, message: S) -> Box<dyn UError> {
Box::new(Self { code, message: message.into() })
Box::new(Self {
code,
message: message.into(),
})
}
}