multiformats / rust-multihash

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

codetable: fix build for blake2s and blake2b features #348

Closed cyphar closed 10 months ago

cyphar commented 10 months ago

In the refactor where each hasher was moved to a separate feature, the conditional compilation of derive_write! was written such that enabling only blake2 hashing will result in compilation errors:

error: cannot find macro `derive_write` in this scope
  --> /home/cyphar/.cargo/registry/src/index.crates.io-6f17d22bba15001f/multihash-codetable-0.1.0/src/hasher_impl.rs:59:9
   |
59 |         derive_write!($name);
   |         ^^^^^^^^^^^^
...
65 |     derive_hasher_blake!(blake2b_simd, Blake2bHasher);
   |     ------------------------------------------------- in this macro invocation
   |
   = note: this error originates in the macro `derive_hasher_blake` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `multihash-codetable` (lib) due to previous error

Fixes: 954e5233d273 ("refactor!: split crates into multiple to isolate breaking changes") Signed-off-by: Aleksa Sarai cyphar@cyphar.com