Skip to content

Commit

Permalink
Use rusftmt-nightly 0.8.3. (zcash#88)
Browse files Browse the repository at this point in the history
* Use rusftmt-nightly 0.8.3.

* Fix rustfmt issues.
  • Loading branch information
porcuquine authored Jul 14, 2018
1 parent 292a9f4 commit 1409d9a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
- run:
name: Install rustfmt-nightly
# this is not cheap, but I did not find a better way
command: cargo install rustfmt-nightly --force
command: cargo install rustfmt-nightly --version=0.8.3 --force
- run:
name: Run cargo fmt
command: cargo fmt -- --check
Expand Down
25 changes: 13 additions & 12 deletions src/drgraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,19 @@ impl MerkleProof {
return false;
}

self.root() == (0..self.path.len()).fold(self.leaf, |h, i| {
a.reset();
let is_right = self.path[i].1;

let (left, right) = if is_right {
(self.path[i].0, h)
} else {
(h, self.path[i].0)
};

a.node(left, right, i)
})
self.root()
== (0..self.path.len()).fold(self.leaf, |h, i| {
a.reset();
let is_right = self.path[i].1;

let (left, right) = if is_right {
(self.path[i].0, h)
} else {
(h, self.path[i].0)
};

a.node(left, right, i)
})
}

/// Validates that the data hashes to the leaf of the merkle path.
Expand Down
3 changes: 2 additions & 1 deletion src/example_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ fn prettyb(num: usize) -> String {
);
let pretty_bytes = format!("{:.2}", num / delimiter.powi(exponent))
.parse::<f64>()
.unwrap() * 1_f64;
.unwrap()
* 1_f64;
let unit = units[exponent as usize];
format!("{}{} {}", negative, pretty_bytes, unit)
}
Expand Down
6 changes: 1 addition & 5 deletions src/zigzag_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ where
pub reversed: bool,
}

impl<'a, G> Layerable for ZigZagGraph<G>
where
G: ZigZag,
{
}
impl<'a, G> Layerable for ZigZagGraph<G> where G: ZigZag {}

impl<G: Graph> ZigZagGraph<G> {
fn new<'b>(nodes: usize, base_degree: usize, expansion_degree: usize) -> Self {
Expand Down

0 comments on commit 1409d9a

Please sign in to comment.