Skip to content

Commit 9fd39f2

Browse files
sylvestrecakebaker
authored andcommitted
dd: source SI/IEC bases from uucore::parser::parse_size
1 parent 1d925e0 commit 9fd39f2

1 file changed

Lines changed: 1 addition & 28 deletions

File tree

src/uu/dd/src/numbers.rs

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,9 @@
55

66
//! Functions for formatting a number as a magnitude and a unit suffix.
77
8-
/// The first ten powers of 1024.
9-
const IEC_BASES: [u128; 10] = [
10-
1,
11-
1_024,
12-
1_048_576,
13-
1_073_741_824,
14-
1_099_511_627_776,
15-
1_125_899_906_842_624,
16-
1_152_921_504_606_846_976,
17-
1_180_591_620_717_411_303_424,
18-
1_208_925_819_614_629_174_706_176,
19-
1_237_940_039_285_380_274_899_124_224,
20-
];
8+
use uucore::parser::parse_size::{IEC_BASES, SI_BASES};
219

2210
const IEC_SUFFIXES: [&str; 9] = ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"];
23-
24-
/// The first ten powers of 1000.
25-
const SI_BASES: [u128; 10] = [
26-
1,
27-
1_000,
28-
1_000_000,
29-
1_000_000_000,
30-
1_000_000_000_000,
31-
1_000_000_000_000_000,
32-
1_000_000_000_000_000_000,
33-
1_000_000_000_000_000_000_000,
34-
1_000_000_000_000_000_000_000_000,
35-
1_000_000_000_000_000_000_000_000_000,
36-
];
37-
3811
const SI_SUFFIXES: [&str; 9] = ["B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
3912

4013
/// A `SuffixType` determines whether the suffixes are 1000 or 1024 based.

0 commit comments

Comments
 (0)