diff --git a/ethereum/consensus-core/src/types/bls.rs b/ethereum/consensus-core/src/types/bls.rs index a9167c15..085a05e8 100644 --- a/ethereum/consensus-core/src/types/bls.rs +++ b/ethereum/consensus-core/src/types/bls.rs @@ -25,8 +25,8 @@ pub struct Signature { impl PublicKey { pub(crate) fn point(&self) -> Result { - let bytes = self.inner.inner.to_vec(); - let bytes = bytes.as_slice().try_into()?; + let bytes: &[u8] = &self.inner.inner; + let bytes = bytes.try_into()?; let point_opt = G1Affine::from_compressed(bytes); if point_opt.is_some().into() { Ok(point_opt.unwrap()) @@ -53,8 +53,8 @@ impl Signature { } fn point(&self) -> Result { - let bytes = self.inner.inner.to_vec(); - let bytes = bytes.as_slice().try_into()?; + let bytes: &[u8] = &self.inner.inner; + let bytes = bytes.try_into()?; let point_opt = G2Affine::from_compressed(bytes); if point_opt.is_some().into() { Ok(point_opt.unwrap())