Closed Rolv-Apneseth closed 1 year ago
This seems to not be consistent with the memory readout, which just returns u64 values, is that intentional?
Good question.
It seems that the choice of 128 bits rather than the dynamically determined 32 bit or 64 bit long integer
is simply an artifact of age.
When the disk space readout was first introduced, @123marvin123 made the choice of returning a byte_unit
and byte_unit::Byte::from_bytes takes as a parameter a 128 bit integer. Sometime after, I removed this dependency because it seemed better to return builtin types rather than "wrapper" types. This means that the cast is unnecessary now, so thanks for pointing this out.
Can I make a couple changes to the things I pointed out above and make a PR for it?
Yes, that would be great!
Alright, I'll make a PR and hopefully you can point out if I made a mistake (not sure exactly how this stuff works tbh)
Thanks a lot, will do.
Alright that's the PR, hopefully I didn't miss anything. I have the code for macchina
to show disk space ready too once everything is approved and the version is updated. Thanks for your time reviewing the code.
So, I have code working for
macchina
to use thedisk_space
function from here, but in formatting it for display there, I need to cast theu128
values asu64
i.e.:This seems to not be consistent with the memory readout, which just returns
u64
values, is that intentional?Also, I believe the description of the function is maybe wrong, as the return type is
Result<(u64, u64), ReadoutError>
:Can I make a couple changes to the things I pointed out above and make a PR for it?