So far, we have only Unbounded to bound the supported types.
However, this may cause issues like (ref):
BSize::kib(16_u64); // compile failed; multiple applicable items in scope
BSize::<u64>::kib(16_u64); // compiled
I'm considering to change the unsigned.rs file to bounds.rs and add a series of trait bounds:
ByteSize = the current Unsigned
SupportKB = [u16, u32, u64, usize]
SupportKiB = [u16, u32, u64, usize]
SupportMB = [u32, u64, usize]
SupportMiB = [u32, u64, usize]
...
Let me demonstrate a changeset and see if it works well or adds too much type noise.
So far, we have only
Unboundedto bound the supported types.However, this may cause issues like (ref):
I'm considering to change the
unsigned.rsfile tobounds.rsand add a series of trait bounds:Let me demonstrate a changeset and see if it works well or adds too much type noise.