Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/uu/checksum_common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub fn standalone_with_length_main(
let tag = matches.get_flag(options::TAG);
let format = OutputFormat::from_standalone(text, tag);

checksum_main(algo, length, matches, format?)
checksum_main(algo, length, matches, format)
}

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

checksum_main(algo, None, matches, format?)
checksum_main(algo, None, matches, format)
}

/// Base command processing for all the checksum executables.
Expand Down
9 changes: 4 additions & 5 deletions src/uucore/src/lib/features/checksum/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,18 @@ impl OutputFormat {
///
/// Since standalone utils can't use the Raw or Legacy output format, it is
/// decided only using the --tag, --binary and --text arguments.
#[allow(clippy::unnecessary_wraps)]
pub fn from_standalone(text: bool, tag: bool) -> UResult<Self> {
pub fn from_standalone(text: bool, tag: bool) -> Self {
if tag {
Ok(Self::Tagged(DigestFormat::Hexadecimal))
Self::Tagged(DigestFormat::Hexadecimal)
} else {
Ok(Self::Untagged(
Self::Untagged(
DigestFormat::Hexadecimal,
if text {
ReadingMode::Text
} else {
ReadingMode::Binary
},
))
)
}
}
}
Expand Down
Loading