-
Notifications
You must be signed in to change notification settings - Fork 61
Closed
Description
In the same spirit as multiformats/rust-multiaddr#71, I want to raise awareness about how disruptive the breaking changes in this fundamental library are for the ecosystem.
I have a few suggestions:
Errorcould be madenon_exhaustiveor completely opaque. The latter would be my personal preference as it gives you more flexibility as a library author.- Move
MultihashDigest&Codeto a separate crate. All we need inrust-multiaddris theMultihashtype which acts as a type-safe representation for a multihash. The machinery aroundMultihashDigest, the actual hash implementations etc could all live in a separate crate. This would reduce the API surface drastically and allowmultihashto remain more stable (and almost dependency free) Codeuses conditional enum variants. That is not ideal. Features are additive across a dependency tree in Rust. Conditional enum variants can turn an exhaustive match in a library into a non-exhaustive one simply because the end-user activates more features ofmultihash.
Curious to hear your thoughts. (And happy to send PRs if we agree on something!)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels