mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
Bound Unsigned when signed is not supported. (#6367)
* bound unsigned when necessary * convert more type to AtLeast32BitUnsigned * Update primitives/arithmetic/src/traits.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * doc refactor * line reorganize Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
b17ccf24a8
commit
44fb311f1f
@@ -79,6 +79,11 @@ pub trait AtLeast32Bit: BaseArithmetic + From<u16> + From<u32> {}
|
||||
|
||||
impl<T: BaseArithmetic + From<u16> + From<u32>> AtLeast32Bit for T {}
|
||||
|
||||
/// A meta trait for arithmetic. Same as [`AtLeast32Bit `], but also bounded to be unsigned.
|
||||
pub trait AtLeast32BitUnsigned: AtLeast32Bit + Unsigned {}
|
||||
|
||||
impl<T: AtLeast32Bit + Unsigned> AtLeast32BitUnsigned for T {}
|
||||
|
||||
/// Just like `From` except that if the source value is too big to fit into the destination type
|
||||
/// then it'll saturate the destination.
|
||||
pub trait UniqueSaturatedFrom<T: Sized>: Sized {
|
||||
|
||||
Reference in New Issue
Block a user