Kriskras99 opened a new pull request, #230: URL: https://github.com/apache/avro-rs/pull/230
Supersedes #229. The size of a `Result` is as large as it's largest variant, thus `AvroResult` is currently always at least 104 bytes. Therefore, even if the function only returns a `usize` on success the function still needs to (stack) allocate 104 bytes. I've renamed the current `Error` enum to `Details`, and actually made it a bit bigger by unboxing `Schema` arguments. The new `Error` type is just a wrapper around a `Box<Details>`. To keep the code simple and make as few changes as possible, I've added a construction function for every variant of `Details`. I've also changed any `ok_or(Error...`) to an `ok_or_else(Error...` as constructing the type is now "expensive" because it does an allocation. This is a breaking change if the user is matching on the error type. The fix is easy as the user can use `details` or `into_details` to get the inner `Details` to match on. When the user is constructing a struct-like variant of the type this is also a breaking change. This can be fixed by changing the curly braces to round brackets and removing the item names. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@avro.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org