From 20ecfce2e244be2288838b93382a0f63bc91a524 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 19 Aug 2024 14:09:37 +0100 Subject: [PATCH] chore: more impls --- noir_stdlib/src/default.nr | 1 + noir_stdlib/src/hash/mod.nr | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/noir_stdlib/src/default.nr b/noir_stdlib/src/default.nr index f79a4df0317..3ac5fbb394e 100644 --- a/noir_stdlib/src/default.nr +++ b/noir_stdlib/src/default.nr @@ -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 } } diff --git a/noir_stdlib/src/hash/mod.nr b/noir_stdlib/src/hash/mod.nr index 3a4e5ca1484..3abc630ab10 100644 --- a/noir_stdlib/src/hash/mod.nr +++ b/noir_stdlib/src/hash/mod.nr @@ -231,6 +231,12 @@ impl Hash for i8 { } } +impl Hash for i16 { + fn hash(self, state: &mut H) where H: Hasher{ + H::write(state, self as Field); + } +} + impl Hash for i32 { fn hash(self, state: &mut H) where H: Hasher{ H::write(state, self as Field);