-
Notifications
You must be signed in to change notification settings - Fork 747
libraries/tock-cells/OptionalCell: remove T: Default
constraint
#3334
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
Conversation
`#[derive(Default)]` incorrectly constraints T: Default, whereas `<Option<T> as Default>::default()` will return None. By manually implementing the trait we can circumvent this restriction. Signed-off-by: Leon Schuermann <leon@is.currently.online>
1e61b18
to
c92c25c
Compare
T: Default
constraintT: Default
constraint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty
and default
seem kinda redundant now.
Do we need to implement default at all? |
That's right. The perhaps most useful property of the |
I think that is fine, bors r+ |
I just noticed that |
Pull Request Overview
#[derive(Default)]
incorrectly constraints T: Default, whereas<Option<T> as Default>::default()
will return None. By manually implementing the trait we can circumvent this restriction.Testing Strategy
This pull request was tested by compiling.
TODO or Help Wanted
N/A
Documentation Updated
Updated the relevant files inor no updates are required./docs
,Formatting
make prepush
.