From 68f82767182be19e39c34daf14fcf63550cf876c Mon Sep 17 00:00:00 2001 From: weikengchen Date: Mon, 31 Aug 2026 10:32:19 +0800 Subject: [PATCH] Fix mismatched lifetime syntax warnings --- poly-commit/src/kzg10/mod.rs | 6 +++--- poly-commit/src/sonic_pc/data_structures.rs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/poly-commit/src/kzg10/mod.rs b/poly-commit/src/kzg10/mod.rs index 81a7b59f..7d4c9405 100644 --- a/poly-commit/src/kzg10/mod.rs +++ b/poly-commit/src/kzg10/mod.rs @@ -488,10 +488,10 @@ mod tests { impl> KZG10 { /// Specializes the public parameters for a given maximum degree `d` for polynomials /// `d` should be less that `pp.max_degree()`. - pub(crate) fn trim( - pp: &UniversalParams, + pub(crate) fn trim<'a>( + pp: &'a UniversalParams, mut supported_degree: usize, - ) -> Result<(Powers, VerifierKey), Error> { + ) -> Result<(Powers<'a, E>, VerifierKey), Error> { if supported_degree == 1 { supported_degree += 1; } diff --git a/poly-commit/src/sonic_pc/data_structures.rs b/poly-commit/src/sonic_pc/data_structures.rs index 4ed8e500..bfc19e68 100644 --- a/poly-commit/src/sonic_pc/data_structures.rs +++ b/poly-commit/src/sonic_pc/data_structures.rs @@ -70,7 +70,7 @@ pub struct CommitterKey { impl CommitterKey { /// Obtain powers for the underlying KZG10 construction - pub fn powers(&self) -> kzg10::Powers { + pub fn powers<'a>(&'a self) -> kzg10::Powers<'a, E> { kzg10::Powers { powers_of_g: self.powers_of_g.as_slice().into(), powers_of_gamma_g: self.powers_of_gamma_g.as_slice().into(), @@ -78,10 +78,10 @@ impl CommitterKey { } /// Obtain powers for committing to shifted polynomials. - pub fn shifted_powers( - &self, + pub fn shifted_powers<'a>( + &'a self, degree_bound: impl Into>, - ) -> Option> { + ) -> Option> { match (&self.shifted_powers_of_g, &self.shifted_powers_of_gamma_g) { (Some(shifted_powers_of_g), Some(shifted_powers_of_gamma_g)) => { let max_bound = self