-
Notifications
You must be signed in to change notification settings - Fork 476
Description
Newtypes allow to constrain what operations make sense on a value in order to prevent mistakes.
Please consider what operations would make sense for the Offset
type alias and provide a newtype instead -- please see the thread at: https://lore.kernel.org/rust-for-linux/CANiq72m_LSbyTOg2b0mvDz4+uN+77gpL8T_yiOqi1vKm+G4FzA@mail.gmail.com/
At the time of writing, the patches would need to be based on top of that patch series to update the upcoming users.
Please take the chance as well to write a couple examples/tests for the newtype.
Cc: @dakr
This requires submitting a proper patch to the LKML and the Rust for Linux mailing list. Please recall to test your changes (including generating the documentation if changed, running the Rust doctests if changed, etc.), to use a proper title for the commit, to sign your commit under the Developer's Certificate of Origin and to add a Suggested-by:
tag, and a Link:
tag to this issue. Please see https://docs.kernel.org/process/submitting-patches.html and https://rust-for-linux.com/contributing for details.