From 5c77a9184aaecfaddf39c49d8bf64343fa7c0720 Mon Sep 17 00:00:00 2001 From: Pedro Fontana Date: Fri, 24 Nov 2023 15:44:18 -0300 Subject: [PATCH] Fix compilation (#17) --- crates/starknet-types-core/src/felt.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/starknet-types-core/src/felt.rs b/crates/starknet-types-core/src/felt.rs index ef43312..86a905d 100644 --- a/crates/starknet-types-core/src/felt.rs +++ b/crates/starknet-types-core/src/felt.rs @@ -276,8 +276,7 @@ impl Felt { result[(32 - buffer.len())..].copy_from_slice(&buffer[..]); - // safe .unwrap() - Felt::from_bytes_be(&result).unwrap() + Felt::from_bytes_be(&result) } // Implemention taken from Jonathan Lei's starknet-rs @@ -301,7 +300,7 @@ impl Felt { let mut result = [0u8; 32]; result[(32 - buffer.len())..].copy_from_slice(&buffer[..]); - Felt::from_bytes_be(&result).ok() + Some(Felt::from_bytes_be(&result)) } /// Remainder of dividing `self` by `n` as integers.