Skip to content

Commit

Permalink
feat: added U8, U16, U64 and U128 into U250
Browse files Browse the repository at this point in the history
  • Loading branch information
aymericdelab committed Jun 8, 2023
1 parent eea378e commit 5336558
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions crates/dojo-core/src/integer.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,36 @@ impl ContractAddressIntoU250 of Into<ContractAddress, u250> {
}
}

impl U8IntoU250 of Into<u8, u250> {
fn into(self: u8) -> u250 {
u250 { inner: self.into() }
}
}

impl U16IntoU250 of Into<u16, u250> {
fn into(self: u16) -> u250 {
u250 { inner: self.into() }
}
}

impl U32IntoU250 of Into<u32, u250> {
fn into(self: u32) -> u250 {
u250 { inner: self.into() }
}
}

impl U64IntoU250 of Into<u64, u250> {
fn into(self: u64) -> u250 {
u250 { inner: self.into() }
}
}

impl U128IntoU250 of Into<u128, u250> {
fn into(self: u128) -> u250 {
u250 { inner: self.into() }
}
}

impl U250IntoFelt252 of Into<u250, felt252> {
fn into(self: u250) -> felt252 {
self.inner
Expand Down

0 comments on commit 5336558

Please sign in to comment.