Skip to content

Commit f47b2d2

Browse files
authored
Remove empty format precision specifier
A format precision specifier consisting of a dot and no number actually does nothing and has no specified meaning. Currently this is silently ignored, but it may turn into a warning or error. See rust-lang/rust#131159 and rust-lang/rust#136638
1 parent 453a03d commit f47b2d2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/xxd/dump.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl<'a> OutputLine<'a> {
123123
}
124124

125125
fn write_address(&self, f: &mut fmt::Formatter) -> Result<usize, anyhow::Error> {
126-
write!(f, "{:08.X}: ", self.output_settings.start_address)?;
126+
write!(f, "{:08X}: ", self.output_settings.start_address)?;
127127
Ok(10)
128128
}
129129

@@ -149,15 +149,15 @@ impl<'a> OutputLine<'a> {
149149
) -> Result<usize, anyhow::Error> {
150150
match self.output_settings.output_fmt {
151151
Format::HexUpperCase => {
152-
write!(f, "{:02.X}", byte)?;
152+
write!(f, "{:02X}", byte)?;
153153
Ok(2)
154154
}
155155
Format::Hex => {
156-
write!(f, "{:02.x}", byte)?;
156+
write!(f, "{:02x}", byte)?;
157157
Ok(2)
158158
}
159159
Format::Octal => {
160-
write!(f, "{:03.o}", byte)?;
160+
write!(f, "{:03o}", byte)?;
161161
Ok(3)
162162
}
163163
Format::Decimal => {

0 commit comments

Comments
 (0)