-
Notifications
You must be signed in to change notification settings - Fork 87
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
Builders require generic types to impl Default even when not needed. #178
Comments
I believe you can use the derivative crate to derive Default and then set Default to boundless: https://mcarton.github.io/rust-derivative/Default.html#custom-bound |
You're correct; I've been short on time and haven't had resources to make sure changes to this crate don't break anyone depending on it. The past few efforts have led to revving the minor version for most changes, but that's not great for people either. The standard library applies the |
Well, this crate is literally unusuable with generic types, unless they all happen to derive
|
This is now live in 0.10.0-alpha. Please test it out and make sure it's working as-expected. |
Example code:
This doesn't build; it complains that
Foo
does not implementDefault
. It obviously doesn't need to, but theDefault
implementation that the#[derive(Default)]
adds the bound anyway. This makes the builder impossible to instantiate for types that take generic types that do not implementDefault
.PS Is this crate still maintained? Last release was a year ago.
The text was updated successfully, but these errors were encountered: