Make code compatible with rust 1.46

This commit is contained in:
merkrafter authored and David Peter committed 2021-11-14 09:26:21 +01:00
1 parent 7a225fe732
commit d1ae68585f
1 file changed
+8 -8
+8 -8
View File
@@ -356,14 +356,14 @@ impl Unit {
const fn get_multiplier(self) -> i64 { const fn get_multiplier(self) -> i64 {
match self { match self {
Self::Byte => 1, Self::Byte => 1,
Self::Kilobyte => 1000i64.pow(1), Self::Kilobyte => 1000,
Self::Megabyte => 1000i64.pow(2), Self::Megabyte => 1000_000,
Self::Gigabyte => 1000i64.pow(3), Self::Gigabyte => 1000_000_000,
Self::Terabyte => 1000i64.pow(4), Self::Terabyte => 1000_000_000_000,
Self::Kibibyte => 1024i64.pow(1), Self::Kibibyte => 1 << 10,
Self::Mebibyte => 1024i64.pow(2), Self::Mebibyte => 1 << 20,
Self::Gibibyte => 1024i64.pow(3), Self::Gibibyte => 1 << 30,
Self::Tebibyte => 1024i64.pow(4), Self::Tebibyte => 1 << 40,
Self::Block { Self::Block {
custom_size: Some(size), custom_size: Some(size),
} => size.get(), } => size.get(),