mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-02-07 06:44:11 +00:00
Adopt idiomatic code suggestions.
This commit is contained in:
parent
34aa52b0f7
commit
6410bdf998
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user