diff --git a/halo2-base/src/poseidon/hasher/mod.rs b/halo2-base/src/poseidon/hasher/mod.rs index 68cf64c6..b477edcf 100644 --- a/halo2-base/src/poseidon/hasher/mod.rs +++ b/halo2-base/src/poseidon/hasher/mod.rs @@ -10,7 +10,7 @@ use crate::{ use getset::{CopyGetters, Getters}; use num_bigint::BigUint; -use std::{cell::OnceCell, mem}; +use std::{mem, sync::OnceLock}; #[cfg(test)] mod tests; @@ -28,7 +28,7 @@ pub struct PoseidonHasher { /// Spec, contains round constants and optimized matrices. #[getset(get = "pub")] spec: OptimizedPoseidonSpec, - consts: OnceCell>, + consts: OnceLock>, } #[derive(Clone, Debug, Getters)] struct PoseidonHasherConsts { @@ -123,7 +123,7 @@ pub struct PoseidonCompactOutput { impl PoseidonHasher { /// Create a poseidon hasher from an existing spec. pub fn new(spec: OptimizedPoseidonSpec) -> Self { - Self { spec, consts: OnceCell::new() } + Self { spec, consts: OnceLock::new() } } /// Initialize necessary consts of hasher. Must be called before any computation. pub fn initialize_consts(&mut self, ctx: &mut Context, gate: &impl GateInstructions) {