-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multihash const constructors unusable #330
Comments
forest have interest in const-construction of CIDs. |
I'd really like to avoid making a breaking change. Can we instead introduce a new function and deprecate I'd also like to see a test for this :) |
Why is that a breaking change. Given that it's not really |
const calling the function would compile, but not accessing the result, so it's a breaking change |
Closing - the constructors aren't unusable. Maybe there should be some user-facing documentation for the See #331 (comment) for closing comment. |
Multihash
's constructors areconst fn
, but they can't actually be used as such:Fails to compile:
This is presumably because the top level error type is non-copy/contains an io::Error which cannot be
const
rust-multihash/src/error.rs
Lines 42 to 50 in 16e68d8
Here is the source for the constructor
rust-multihash/src/multihash.rs
Lines 59 to 75 in 16e68d8
Fix is either:
const
from thewrap
constructor. This is a breaking changewrap
return a new, const-compatibleInvalidSize
error in its constructor. This is also a breaking change. This is my preference, and I'm happy to create a PR for such a change.The text was updated successfully, but these errors were encountered: