mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-06 20:41:14 +00:00
Remove explicit lifetimes
This commit is contained in:
parent
c8e7e22ddf
commit
7f4b96150d
3 changed files with 14 additions and 20 deletions
|
|
@ -116,7 +116,7 @@ impl Debug for CompressedEdwardsY {
|
||||||
|
|
||||||
impl CompressedEdwardsY {
|
impl CompressedEdwardsY {
|
||||||
/// View this `CompressedEdwardsY` as an array of bytes.
|
/// 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
|
&self.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
10
src/field.rs
10
src/field.rs
|
|
@ -110,16 +110,14 @@ impl Debug for FieldElement {
|
||||||
impl Index<usize> for FieldElement {
|
impl Index<usize> for FieldElement {
|
||||||
type Output = Limb;
|
type Output = Limb;
|
||||||
|
|
||||||
fn index<'a>(&'a self, _index: usize) -> &'a Limb {
|
fn index(&self, _index: usize) -> &Limb {
|
||||||
let ret: &'a Limb = &(self.0[_index]);
|
&(self.0[_index])
|
||||||
ret
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl IndexMut<usize> for FieldElement {
|
impl IndexMut<usize> for FieldElement {
|
||||||
fn index_mut<'a>(&'a mut self, _index: usize) -> &'a mut Limb {
|
fn index_mut(&mut self, _index: usize) -> &mut Limb {
|
||||||
let ret: &'a mut Limb = &mut(self.0[_index]);
|
&mut(self.0[_index])
|
||||||
ret
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,16 +90,14 @@ impl CTEq for Scalar {
|
||||||
impl Index<usize> for Scalar {
|
impl Index<usize> for Scalar {
|
||||||
type Output = u8;
|
type Output = u8;
|
||||||
|
|
||||||
fn index<'a>(&'a self, _index: usize) -> &'a u8 {
|
fn index(&self, _index: usize) -> &u8 {
|
||||||
let ret: &'a u8 = &(self.0[_index]);
|
&(self.0[_index])
|
||||||
ret
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl IndexMut<usize> for Scalar {
|
impl IndexMut<usize> for Scalar {
|
||||||
fn index_mut<'a>(&'a mut self, _index: usize) -> &'a mut u8 {
|
fn index_mut(&mut self, _index: usize) -> &mut u8 {
|
||||||
let ret: &'a mut u8 = &mut(self.0[_index]);
|
&mut(self.0[_index])
|
||||||
ret
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -194,7 +192,7 @@ impl Scalar {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// View this `Scalar` as a sequence of bytes.
|
/// 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
|
&self.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -381,16 +379,14 @@ pub struct UnpackedScalar(pub [i64; 12]);
|
||||||
impl Index<usize> for UnpackedScalar {
|
impl Index<usize> for UnpackedScalar {
|
||||||
type Output = i64;
|
type Output = i64;
|
||||||
|
|
||||||
fn index<'a>(&'a self, _index: usize) -> &'a i64 {
|
fn index(&self, _index: usize) -> &i64 {
|
||||||
let ret: &'a i64 = &(self.0[_index]);
|
&(self.0[_index])
|
||||||
ret
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl IndexMut<usize> for UnpackedScalar {
|
impl IndexMut<usize> for UnpackedScalar {
|
||||||
fn index_mut<'a>(&'a mut self, _index: usize) -> &'a mut i64 {
|
fn index_mut(&mut self, _index: usize) -> &mut i64 {
|
||||||
let ret: &'a mut i64 = &mut(self.0[_index]);
|
&mut(self.0[_index])
|
||||||
ret
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue