Skip to content

Commit 685203a

Browse files
oech3cakebaker
authored andcommitted
cksum family: delete useless wrap
1 parent 744ca5e commit 685203a

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/uu/checksum_common/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub fn standalone_with_length_main(
7979
let tag = matches.get_flag(options::TAG);
8080
let format = OutputFormat::from_standalone(text, tag);
8181

82-
checksum_main(algo, length, matches, format?)
82+
checksum_main(algo, length, matches, format)
8383
}
8484

8585
/// Entrypoint for standalone checksums *NOT* accepting the `--length` argument
@@ -91,7 +91,7 @@ pub fn standalone_main(algo: AlgoKind, cmd: Command, args: impl uucore::Args) ->
9191
let tag = matches.get_flag(options::TAG);
9292
let format = OutputFormat::from_standalone(text, tag);
9393

94-
checksum_main(algo, None, matches, format?)
94+
checksum_main(algo, None, matches, format)
9595
}
9696

9797
/// Base command processing for all the checksum executables.

src/uucore/src/lib/features/checksum/compute.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,18 @@ impl OutputFormat {
115115
///
116116
/// Since standalone utils can't use the Raw or Legacy output format, it is
117117
/// decided only using the --tag, --binary and --text arguments.
118-
#[allow(clippy::unnecessary_wraps)]
119-
pub fn from_standalone(text: bool, tag: bool) -> UResult<Self> {
118+
pub fn from_standalone(text: bool, tag: bool) -> Self {
120119
if tag {
121-
Ok(Self::Tagged(DigestFormat::Hexadecimal))
120+
Self::Tagged(DigestFormat::Hexadecimal)
122121
} else {
123-
Ok(Self::Untagged(
122+
Self::Untagged(
124123
DigestFormat::Hexadecimal,
125124
if text {
126125
ReadingMode::Text
127126
} else {
128127
ReadingMode::Binary
129128
},
130-
))
129+
)
131130
}
132131
}
133132
}

0 commit comments

Comments
 (0)