implement ZeroableOption for NonZero* types#110
implement ZeroableOption for NonZero* types#110BennoLossin merged 1 commit intoRust-for-Linux:mainfrom
Conversation
BennoLossin
left a comment
There was a problem hiding this comment.
Thanks a lot for the PR!
Please use the kernel's commit message style. So give a motivation in addition to explaining what the change is.
We also don't use the issue: tag. Instead use Link:.
Please also mention this change in the changelog.
BennoLossin
left a comment
There was a problem hiding this comment.
The code itself looks good. One suggestion for the changelog inline.
Lastly, we should offer some motivation for the change in the commit message. The idea is that Option<NonZero*> automatically implements Zeroable through the blanket impl that comes from implementing ZeroableOption for NonZero*, better encoding the situation.
BennoLossin
left a comment
There was a problem hiding this comment.
Changes look good now, thanks!
Can you rebase on top of main? Then we can re-run the CI tests.
Sure! |
add a macro for implementing `ZeroableOption` for `NonZero*` types. `Option<NonZero*>` now automatically implements `Zeroable` trait by implementing `ZeroableOption` for `NonZero*` types, which serves as a blanket impl. Closes: Rust-for-Linux#95 Signed-off-by: Hamdan-Khan <hamdankhan212@gmail.com> Signed-off-by: Benno Lossin <lossin@kernel.org>
|
Thanks! |
add a macro for implementing ZeroableOption for NonZero* integer types instead of using Option<NonZero*> inside zeroable macro
issue: #95