1 2 3 4 5 6 7 8 9 10 11 12
pub type Byte = byte_unit::Byte; #[cfg(test)] mod tests { use super::*; #[test] fn parse() { assert_eq!(4_u64 * 1024 * 1024, Byte::parse_str("4MiB", true).unwrap()); assert_eq!(4_u64 * 1000 * 1000, Byte::parse_str("4MB", true).unwrap()); } }