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.
Metadata
Metadata
Assignees
Labels
No labels