Adopt idiomatic code suggestions.
This commit is contained in:
parent
34aa52b0f7
commit
6410bdf998
|
@ -334,7 +334,7 @@ impl PrimeFieldRepr for FqRepr {
|
|||
|
||||
while n >= 64 {
|
||||
let mut t = 0;
|
||||
for i in self.0.iter_mut() {
|
||||
for i in &mut self.0 {
|
||||
::std::mem::swap(&mut t, i);
|
||||
}
|
||||
n -= 64;
|
||||
|
|
|
@ -170,7 +170,7 @@ impl PrimeFieldRepr for FrRepr {
|
|||
|
||||
while n >= 64 {
|
||||
let mut t = 0;
|
||||
for i in self.0.iter_mut() {
|
||||
for i in &mut self.0 {
|
||||
::std::mem::swap(&mut t, i);
|
||||
}
|
||||
n -= 64;
|
||||
|
|
|
@ -482,7 +482,7 @@ pub trait PrimeField: Field
|
|||
/// Interpret a string of numbers as a (congruent) prime field element.
|
||||
/// Does not accept unnecessary leading zeroes or a blank string.
|
||||
fn from_str(s: &str) -> Option<Self> {
|
||||
if s.len() == 0 {
|
||||
if s.is_empty() {
|
||||
return None;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue