diff --git a/src/curve.rs b/src/curve.rs index ff82477..872d4d3 100644 --- a/src/curve.rs +++ b/src/curve.rs @@ -116,7 +116,7 @@ impl Debug for CompressedEdwardsY { impl CompressedEdwardsY { /// View this `CompressedEdwardsY` as an array of bytes. - pub fn as_bytes<'a>(&'a self) -> &'a [u8; 32] { + pub fn as_bytes(&self) -> &[u8; 32] { &self.0 } diff --git a/src/field.rs b/src/field.rs index 2545d02..1495d17 100644 --- a/src/field.rs +++ b/src/field.rs @@ -110,16 +110,14 @@ impl Debug for FieldElement { impl Index for FieldElement { type Output = Limb; - fn index<'a>(&'a self, _index: usize) -> &'a Limb { - let ret: &'a Limb = &(self.0[_index]); - ret + fn index(&self, _index: usize) -> &Limb { + &(self.0[_index]) } } impl IndexMut for FieldElement { - fn index_mut<'a>(&'a mut self, _index: usize) -> &'a mut Limb { - let ret: &'a mut Limb = &mut(self.0[_index]); - ret + fn index_mut(&mut self, _index: usize) -> &mut Limb { + &mut(self.0[_index]) } } diff --git a/src/scalar.rs b/src/scalar.rs index 5d6a5ec..8606913 100644 --- a/src/scalar.rs +++ b/src/scalar.rs @@ -90,16 +90,14 @@ impl CTEq for Scalar { impl Index for Scalar { type Output = u8; - fn index<'a>(&'a self, _index: usize) -> &'a u8 { - let ret: &'a u8 = &(self.0[_index]); - ret + fn index(&self, _index: usize) -> &u8 { + &(self.0[_index]) } } impl IndexMut for Scalar { - fn index_mut<'a>(&'a mut self, _index: usize) -> &'a mut u8 { - let ret: &'a mut u8 = &mut(self.0[_index]); - ret + fn index_mut(&mut self, _index: usize) -> &mut u8 { + &mut(self.0[_index]) } } @@ -194,7 +192,7 @@ impl Scalar { } /// View this `Scalar` as a sequence of bytes. - pub fn as_bytes<'a>(&'a self) -> &'a [u8;32] { + pub fn as_bytes(&self) -> &[u8;32] { &self.0 } @@ -381,16 +379,14 @@ pub struct UnpackedScalar(pub [i64; 12]); impl Index for UnpackedScalar { type Output = i64; - fn index<'a>(&'a self, _index: usize) -> &'a i64 { - let ret: &'a i64 = &(self.0[_index]); - ret + fn index(&self, _index: usize) -> &i64 { + &(self.0[_index]) } } impl IndexMut for UnpackedScalar { - fn index_mut<'a>(&'a mut self, _index: usize) -> &'a mut i64 { - let ret: &'a mut i64 = &mut(self.0[_index]); - ret + fn index_mut(&mut self, _index: usize) -> &mut i64 { + &mut(self.0[_index]) } }