diff --git a/rln/src/circuit.rs b/rln/src/circuit.rs index de7b29c..a893774 100644 --- a/rln/src/circuit.rs +++ b/rln/src/circuit.rs @@ -145,7 +145,7 @@ pub fn circom_from_folder(resources_folder: &str) -> Result<&'static Mutex Result { - Ok(Fq::try_from(BigUint::from_str(s)?)?) + Ok(Fq::from(BigUint::from_str(s)?)) } // Extracts the element in G1 corresponding to its JSON serialization diff --git a/rln/src/utils.rs b/rln/src/utils.rs index d35c0b8..581d070 100644 --- a/rln/src/utils.rs +++ b/rln/src/utils.rs @@ -8,7 +8,7 @@ use num_traits::Num; use std::iter::Extend; pub fn to_bigint(el: &Fr) -> Result { - let res: BigUint = (*el).try_into()?; + let res: BigUint = (*el).into(); Ok(res.into()) } @@ -28,10 +28,10 @@ pub fn str_to_fr(input: &str, radix: u32) -> Result { input_clean = input_clean.trim().to_string(); if radix == 10 { - Ok(BigUint::from_str_radix(&input_clean, radix)?.try_into()?) + Ok(BigUint::from_str_radix(&input_clean, radix)?.into()) } else { input_clean = input_clean.replace("0x", ""); - Ok(BigUint::from_str_radix(&input_clean, radix)?.try_into()?) + Ok(BigUint::from_str_radix(&input_clean, radix)?.into()) } }