Skip to content

Commit

Permalink
chore: more impls
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Aug 19, 2024
1 parent a263510 commit 20ecfce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions noir_stdlib/src/default.nr
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ impl Default for u32 { fn default() -> u32 { 0 } }
impl Default for u64 { fn default() -> u64 { 0 } }

impl Default for i8 { fn default() -> i8 { 0 } }
impl Default for i16 { fn default() -> i16 { 0 } }
impl Default for i32 { fn default() -> i32 { 0 } }
impl Default for i64 { fn default() -> i64 { 0 } }

Expand Down
6 changes: 6 additions & 0 deletions noir_stdlib/src/hash/mod.nr
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ impl Hash for i8 {
}
}

impl Hash for i16 {
fn hash<H>(self, state: &mut H) where H: Hasher{
H::write(state, self as Field);
}
}

impl Hash for i32 {
fn hash<H>(self, state: &mut H) where H: Hasher{
H::write(state, self as Field);
Expand Down

0 comments on commit 20ecfce

Please sign in to comment.