Adopt idiomatic code suggestions.

This commit is contained in:
Sean Bowe 2017-07-31 09:39:57 -06:00
parent 34aa52b0f7
commit 6410bdf998
No known key found for this signature in database
GPG Key ID: 95684257D8F8B031
3 changed files with 3 additions and 3 deletions

View File

@ -334,7 +334,7 @@ impl PrimeFieldRepr for FqRepr {
while n >= 64 { while n >= 64 {
let mut t = 0; let mut t = 0;
for i in self.0.iter_mut() { for i in &mut self.0 {
::std::mem::swap(&mut t, i); ::std::mem::swap(&mut t, i);
} }
n -= 64; n -= 64;

View File

@ -170,7 +170,7 @@ impl PrimeFieldRepr for FrRepr {
while n >= 64 { while n >= 64 {
let mut t = 0; let mut t = 0;
for i in self.0.iter_mut() { for i in &mut self.0 {
::std::mem::swap(&mut t, i); ::std::mem::swap(&mut t, i);
} }
n -= 64; n -= 64;

View File

@ -482,7 +482,7 @@ pub trait PrimeField: Field
/// Interpret a string of numbers as a (congruent) prime field element. /// Interpret a string of numbers as a (congruent) prime field element.
/// Does not accept unnecessary leading zeroes or a blank string. /// Does not accept unnecessary leading zeroes or a blank string.
fn from_str(s: &str) -> Option<Self> { fn from_str(s: &str) -> Option<Self> {
if s.len() == 0 { if s.is_empty() {
return None; return None;
} }