With the release of v0.19 we broke the ability to use Serde in no_std contexts. When you compile with:
$ cargo build --no-default-features --features serde
Compiling multihash v0.19.0 (/tmp/rust-multihash)
error[E0432]: unresolved import `std`
--> src/serde.rs:3:5
|
3 | use std::fmt;
| ^^^ use of undeclared crate or module `std`
error: cannot find macro `format` in this scope
--> src/serde.rs:35:46
|
35 | .map_err(|err| de::Error::custom(format!("Failed to deserialize Multihash: {}", err)))
| ^^^^^^
error: cannot find macro `format` in this scope
--> src/serde.rs:48:46
|
48 | .map_err(|err| de::Error::custom(format!("Failed to deserialize Multihash: {}", err)))
| ^^^^^^
error[E0599]: no method named `to_bytes` found for reference `&Multihash<SIZE>` in the current scope
--> src/serde.rs:17:42
|
17 | serializer.serialize_bytes(&self.to_bytes())
| ^^^^^^^^ method not found in `&Multihash<SIZE>`
error[E0433]: failed to resolve: use of undeclared type `Vec`
--> src/serde.rs:43:25
|
43 | let mut bytes = Vec::new();
| ^^^ use of undeclared type `Vec`
Some errors have detailed explanations: E0432, E0433, E0599.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `multihash` (lib) due to 5 previous errors
With the release of v0.19 we broke the ability to use Serde in no_std contexts. When you compile with:
This is a regression as it works with v0.18.