diff --git a/.circleci/config.yml b/.circleci/config.yml index 9062b0de..30497ab4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/src/drgraph.rs b/src/drgraph.rs index 6056bdef..bb66a7fe 100644 --- a/src/drgraph.rs +++ b/src/drgraph.rs @@ -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. diff --git a/src/example_helper.rs b/src/example_helper.rs index b41dc96d..c7f84a94 100644 --- a/src/example_helper.rs +++ b/src/example_helper.rs @@ -26,7 +26,8 @@ fn prettyb(num: usize) -> String { ); let pretty_bytes = format!("{:.2}", num / delimiter.powi(exponent)) .parse::() - .unwrap() * 1_f64; + .unwrap() + * 1_f64; let unit = units[exponent as usize]; format!("{}{} {}", negative, pretty_bytes, unit) } diff --git a/src/zigzag_graph.rs b/src/zigzag_graph.rs index 3cb7bcb5..ab05de77 100644 --- a/src/zigzag_graph.rs +++ b/src/zigzag_graph.rs @@ -14,11 +14,7 @@ where pub reversed: bool, } -impl<'a, G> Layerable for ZigZagGraph -where - G: ZigZag, -{ -} +impl<'a, G> Layerable for ZigZagGraph where G: ZigZag {} impl ZigZagGraph { fn new<'b>(nodes: usize, base_degree: usize, expansion_degree: usize) -> Self {