Address feedback from Niklas

This commit is contained in:
James Wilson
2021-08-11 16:59:11 +01:00
parent f089ad1758
commit f26b39ac63
15 changed files with 62 additions and 38 deletions
+3 -2
View File
@@ -23,7 +23,8 @@ impl ByteSize {
pub fn new(bytes: usize) -> ByteSize {
ByteSize(bytes)
}
pub fn into_bytes(self) -> usize {
/// Return the number of bytes stored within.
pub fn num_bytes(self) -> usize {
self.0
}
}
@@ -101,7 +102,7 @@ mod test {
for (s, expected) in cases {
let b: ByteSize = s.parse().unwrap();
assert_eq!(b.into_bytes(), expected);
assert_eq!(b.num_bytes(), expected);
}
}
}