We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
assert!
const fn
1 parent ee6e92b commit 73ff5c8Copy full SHA for 73ff5c8
crates/starknet-types-core/src/felt/non_zero.rs
@@ -19,10 +19,9 @@ impl NonZeroFelt {
19
/// # Safety
20
/// If the value is zero will panic.
21
pub const fn from_raw(value: [u64; 4]) -> Self {
22
- assert!(
23
- value[0] != 0 || value[1] != 0 || value[2] != 0 || value[3] != 0,
24
- "Felt is zero"
25
- );
+ if value[0] == 0 && value[1] == 0 && value[2] == 0 && value[3] == 0 {
+ panic!("Felt is zero");
+ }
26
let value = Felt::from_raw(value);
27
Self(value.0)
28
}
0 commit comments