Ten0 / serde_avro_fast

An idiomatic implementation of serde/avro (de)serialization
GNU Lesser General Public License v3.0
20 stars 4 forks source link

Get compression buffer size from zstd #11

Closed Jesse-Bakker closed 8 months ago

Jesse-Bakker commented 8 months ago

The hard-coded buffer size is sometimes too small. Get the worst-case buffer size from zstd instead.

Ten0 commented 8 months ago

Do you mean that this currently causes an error? I had read from the doc that WriteBuf represented a resizable bytes container which may or may not get resized by zstd so I assumed the zstd crate would take care of reallocating it as necessary... Looking closer at the trait signature it does seem indeed to not be part of impl WriteBuf for Vec ^^'

Ten0 commented 8 months ago

In any case, published in 0.4.1

Jesse-Bakker commented 8 months ago

Yes, it causes errors in practice. I agree the description of the WriteBuf trait implies that it will resize it, but I got the error, so that was an easy way to verify that it doesn't 😉