Skip to content

API redesign that takes ownership of internally mutable data and adds an error type for clarity

Johannes Hayeß requested to merge api-redesign into master

This is my proposal for API changes for olm-rs 2.0.

These changes are made, because, in some cases, libolm will modify provided buffers to avoid memory allocation. For example, base64 encoded data is decoded in place. To avoid violating the ownership model, I've made those function arguments require full ownership, where they don't already. I've also noticed that in a lot of places we take ownership where we don't have to, so I've turned those arguments into borrows instead.

The error type change was Clippy's suggestion, which I thought was good and if we're already making breaking changes, we can also clean up this kind of stuff.

Merge request reports