cobs.rs icon indicating copy to clipboard operation
cobs.rs copied to clipboard

Make overhead and encoding len functions const

Open robamu opened this issue 2 years ago • 4 comments

It would be nice if the max_encoding_length and a new max_encoding_overhead functions could be used when declaring and initializing buffers (e.g. encoded data buffer).

I made those functions constant to allow this. I also added a separate function to only calculate the overhead and added a few basic tests.

I did not see a CHANGELOG to add those additions / improvements. What do you think about adding a CHANGELOG?

robamu avatar Jan 02 '23 13:01 robamu

Any updates on this?

robamu avatar Jul 11 '23 21:07 robamu

You might want to add #[inline] to the functions

amsam0 avatar Aug 11 '23 03:08 amsam0

I added the #[inline] attributes

robamu avatar Aug 14 '23 12:08 robamu

Any chance this could get checked and possibly merged? I'd love to use the upstream again :)

robamu avatar Apr 17 '24 13:04 robamu