-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
The code around the Zeroable and ZeroableOption traits in src/lib.rs has evolved and can benefit from some cleanup for clarity and maintainability.
-
Reorder definitions and implementations
- Ensure consistency in placement: put the
Zeroabletrait and its implementations (including macro invocations) first in the relevant section ofsrc/lib.rs, followed by theZeroableOptiontrait and its implementations. - This includes all macro definitions & uses related to these traits.
- Ensure consistency in placement: put the
-
Rename macro for clarity
- One of the macros is currently named
impl_non_zero_int_zeroable_option; it should be renamed toimpl_zeroable_optionfor consistency.
- One of the macros is currently named
-
Macro usage for generic impls
- Use the
impl_zeroable_optionmacro to handle generic impls for types like&T,&mut T,NonNull<T>, and others (for whichOption<T>is guaranteed to be zeroable). - This requires modifying the macro to support generics like
impl_zeroable.
- Use the
Please make sure your changes abide by the Linux kernel's contribution rules. Before submitting a PR, read and follow the guidelines in CONTRIBUTING.md.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers