mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
od: use assert! instead of if then panic!
This commit is contained in:
parent
de158c0122
commit
6aee05a0f1
1 changed files with 6 additions and 7 deletions
|
@ -145,13 +145,12 @@ impl OutputInfo {
|
|||
byte_size_block: usize,
|
||||
print_width_block: usize,
|
||||
) -> [usize; MAX_BYTES_PER_UNIT] {
|
||||
if byte_size_block > MAX_BYTES_PER_UNIT {
|
||||
panic!(
|
||||
assert!(
|
||||
byte_size_block <= MAX_BYTES_PER_UNIT,
|
||||
"{}-bits types are unsupported. Current max={}-bits.",
|
||||
8 * byte_size_block,
|
||||
8 * MAX_BYTES_PER_UNIT
|
||||
);
|
||||
}
|
||||
let mut spacing = [0; MAX_BYTES_PER_UNIT];
|
||||
|
||||
let mut byte_size = sf.byte_size();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue