-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Closed
Description
Currently, there are functions
fn checked_add(self, other: u8) -> Option<u8>
fn saturating_add(self, other: u8) -> u8
fn wrapping_add(self, rhs: u8) -> u8
fn overflowing_add(self, rhs: u8) -> (u8, bool)
for addition on u8. We should have this functionality also for casts, that is, functions like
fn checked_cast(self: u32) -> Option<u8>
fn saturating_cast(self: u32) -> u8
fn wrapping_cast(self: u32) -> u8
fn overflowing_cast(self: u32) -> (u8, bool)
with the obvious implementations. Specific traits for this functionality are up for debate.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.