Closed mmilata closed 1 year ago
I see. These are both good features - using range-contains versus supporting const. I think the range-contains situation will resolve itself eventually, so I'll add the const
keyword to Version::new()
once that is possible.
If you need the functionality immediately, you're better off maintaining a private fork/patch.
Fair enough, I can just define the array size constant directly instead of computing it from version, it's not as nice but not good enough reason for private fork.
I gave you suggestion some thought and I see the merit of your use-case. Indeed, I wanted to support something like Version::new(10).buffer_len() and use that to size an array variable whose length is fixed at compile time. This is something I supported in the C port, and kind of supported in the Rust port with Version::MIN and Version::MAX... but those work because they construct using Version(1)
and Version(40)
using the internal private mechanism, which is why they don't have the same problem that Version::new()
has.
Commits https://github.com/nayuki/QR-Code-generator/commit/5d9ec8dfdddbd66e14833130aa849b7ca5a894e1 , https://github.com/nayuki/QR-Code-generator/commit/2643e824eb15064662e6c4d99b010740275a0be1 .
Thank you!
Awesome library, appreciate the rust-no-heap version, it's working great! I'd like to define local max version, since anything larger doesn't fit on the device screen:
For that it would be useful if
Version::new
was const. Unforunately it's not only a matter of adding the keyword sinceRangeInclusive::contains
is not (yet?) const.