Adopt idiomatic code suggestions.
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user