mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
Merge pull request #4760 from cakebaker/test_wc_use_variables_directly_in_format_strings
test,wc: use vars directly in format! strings
This commit is contained in:
commit
fe7dd4071d
2 changed files with 7 additions and 7 deletions
|
@ -16,12 +16,12 @@ pub type ParseResult<T> = Result<T, ParseError>;
|
||||||
impl std::fmt::Display for ParseError {
|
impl std::fmt::Display for ParseError {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
Self::Expected(s) => write!(f, "expected {}", s),
|
Self::Expected(s) => write!(f, "expected {s}"),
|
||||||
Self::ExpectedValue => write!(f, "expected value"),
|
Self::ExpectedValue => write!(f, "expected value"),
|
||||||
Self::MissingArgument(s) => write!(f, "missing argument after {}", s),
|
Self::MissingArgument(s) => write!(f, "missing argument after {s}"),
|
||||||
Self::ExtraArgument(s) => write!(f, "extra argument {}", s),
|
Self::ExtraArgument(s) => write!(f, "extra argument {s}"),
|
||||||
Self::UnknownOperator(s) => write!(f, "unknown operator {}", s),
|
Self::UnknownOperator(s) => write!(f, "unknown operator {s}"),
|
||||||
Self::InvalidInteger(s) => write!(f, "invalid integer {}", s),
|
Self::InvalidInteger(s) => write!(f, "invalid integer {s}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,9 +28,9 @@ impl<'a> fmt::Display for BufReadDecoderError<'a> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match *self {
|
match *self {
|
||||||
BufReadDecoderError::InvalidByteSequence(bytes) => {
|
BufReadDecoderError::InvalidByteSequence(bytes) => {
|
||||||
write!(f, "invalid byte sequence: {:02x?}", bytes)
|
write!(f, "invalid byte sequence: {bytes:02x?}")
|
||||||
}
|
}
|
||||||
BufReadDecoderError::Io(ref err) => write!(f, "underlying bytestream error: {}", err),
|
BufReadDecoderError::Io(ref err) => write!(f, "underlying bytestream error: {err}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue