rsalmei / human-repr

Generate beautiful human representations of bytes, durations, and even throughputs!
https://crates.io/crates/human-repr
MIT License
34 stars 3 forks source link

Ability to use SI and IEC together #7

Open DDtKey opened 7 months ago

DDtKey commented 7 months ago

Thanks for the library!

I’d like to be able to use both SI and IEC within the same crate, instead of changing the behavior with feature.

Probably just separate function names for iec? It still can be under the feature to extend the trait

rsalmei commented 7 months ago

Sure thing! 👍

Humm, really? I haven't anticipated anyone would like to use both together...

I can do it, but I'll have to think it through. Well, the public API of human-repr are its three traits, so perhaps I could externalize all combinations within them, and have the simpler iconic methods be controlled by the features...

It should take a while, I'm afraid. I'm dealing with another ticket at the moment, and even other projects of mine, but I'll get to it eventually.

DDtKey commented 7 months ago

I haven't anticipated anyone would like to use both together...

I think it's not that weird, for example the output depends on some input params, so we can use either IEC or SI regardless of features, just by intention using conditions in runtime.

It should take a while,

Sure, take your time. Thanks for considering the idea

rsalmei commented 7 months ago

Yep, you're right. Sure, you're welcome!