We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ecd475 commit c72ffa9Copy full SHA for c72ffa9
src/lib.rs
@@ -61,16 +61,19 @@ pub const PIB: u64 = 1_125_899_906_842_624;
61
/// IEC (binary) units.
62
///
63
/// See <https://en.wikipedia.org/wiki/Kilobyte>.
64
-static UNITS_IEC: &str = "KMGTPE";
+const UNITS_IEC: &str = "KMGTPE";
65
66
/// SI (decimal) units.
67
68
69
70
-static UNITS_SI: &str = "kMGTPE";
+const UNITS_SI: &str = "kMGTPE";
71
72
-static LN_KIB: f64 = 6.931471806; // ln 1024
73
-static LN_KB: f64 = 6.907755279; // ln 1000
+/// `ln(1024) ~= 6.931`
+const LN_KIB: f64 = 6.931471806;
74
+
75
+/// `ln(1000) ~= 6.908`
76
+const LN_KB: f64 = 6.907755279;
77
78
pub fn kb<V: Into<u64>>(size: V) -> u64 {
79
size.into() * KB
0 commit comments