tools/format: implement from u64 for HumanByte helper type
Could be problematic for systems where usize is 32 bit, but we do not really support those. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
5a718dce17
commit
c86b6f40d7
@ -80,6 +80,11 @@ impl From<usize> for HumanByte {
|
|||||||
HumanByte { b: v }
|
HumanByte { b: v }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
impl From<u64> for HumanByte {
|
||||||
|
fn from(v: u64) -> Self {
|
||||||
|
HumanByte { b: v as usize }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn correct_byte_convert() {
|
fn correct_byte_convert() {
|
||||||
|
Loading…
Reference in New Issue
Block a user