Skip to content

Commit 0b8ce77

Browse files
committed
df: fix formatting, add test case and fix linting
1 parent c9556e5 commit 0b8ce77

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/uu/df/src/blocks.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ pub(crate) fn read_block_size(matches: &ArgMatches) -> Result<BlockSize, ParseSi
191191
}
192192
}
193193

194-
195194
impl fmt::Display for BlockSize {
196195
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
197196
match self {

src/uu/df/src/table.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -311,13 +311,13 @@ impl<'a> RowFormatter<'a> {
311311
bytes_column.bytes
312312
};
313313
to_magnitude_and_suffix(size.into(), SuffixType::HumanReadable(h), true)
314-
}else {
314+
} else {
315315
match &self.options.block_size {
316-
/// if it has a suffix, append it to the size (but not on the 'total' row)
316+
// if it has a suffix, append it to the size (but not on the 'total' row)
317317
BlockSize::PrefixedBytes(_, suffix) if !self.is_total_row => {
318-
format!("{}{}", size, suffix)
318+
format!("{size}{suffix}")
319319
}
320-
/// else, just print the raw number as before
320+
// else, just print the raw number as before
321321
_ => size.to_string(),
322322
}
323323
};
@@ -332,11 +332,11 @@ impl<'a> RowFormatter<'a> {
332332
to_magnitude_and_suffix(size, SuffixType::HumanReadable(h), true)
333333
} else {
334334
match &self.options.block_size {
335-
/// if it has a suffix, append it to the size (but not on the 'total' row)
335+
// if it has a suffix, append it to the size (but not on the 'total' row)
336336
BlockSize::PrefixedBytes(_, suffix) if !self.is_total_row => {
337-
format!("{}{}", size, suffix)
337+
format!("{size}{suffix}")
338338
}
339-
/// else, just print the raw number as before
339+
// else, just print the raw number as before
340340
_ => size.to_string(),
341341
}
342342
};

0 commit comments

Comments
 (0)