multiformats / rust-multihash

multihash implementation in Rust
https://github.com/multiformats/multihash
Other
150 stars 60 forks source link

fix: make Serde (de)serialization no_std compatible #337

Closed vmx closed 1 year ago

vmx commented 1 year ago

multihash v0.19 introduced a regression. It's no longer possible to compile with no_std and serde feature enabled. This commit fixes that regression.

Due to generic_const_exprs not being a thing yet, we need to use unsafe code to provide this functionality.

Fixes #336.