From 7488d19ae6c8280ba7c24c1ec19507bd3d5555e8 Mon Sep 17 00:00:00 2001 From: Greg Fitzgerald Date: Thu, 22 Mar 2018 14:40:28 -0600 Subject: [PATCH] Clippy review --- src/entry.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/entry.rs b/src/entry.rs index 36db0d841..56a612bb4 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -9,8 +9,8 @@ pub struct Entry { } impl Entry { - /// Creates a Entry from the number of hashes 'num_hashes' since the previous event - /// and that resulting 'id'. + /// Creates a Entry from the number of hashes `num_hashes` since the previous event + /// and that resulting `id`. pub fn new_tick(num_hashes: u64, id: &Hash) -> Self { Entry { num_hashes, @@ -19,7 +19,7 @@ impl Entry { } } - /// Verifies self.id is the result of hashing a 'start_hash' 'self.num_hashes' times. + /// Verifies self.id is the result of hashing a `start_hash` `self.num_hashes` times. /// If the event is not a Tick, then hash that as well. pub fn verify(&self, start_hash: &Hash) -> bool { for event in &self.events { @@ -31,7 +31,7 @@ impl Entry { } } -/// Creates the hash 'num_hashes' after start_hash. If the event contains +/// Creates the hash `num_hashes` after `start_hash`. If the event contains /// signature, the final hash will be a hash of both the previous ID and /// the signature. pub fn next_hash(start_hash: &Hash, num_hashes: u64, events: &[Event]) -> Hash { @@ -56,7 +56,7 @@ pub fn next_hash(start_hash: &Hash, num_hashes: u64, events: &[Event]) -> Hash { id } -/// Creates the next Entry 'num_hashes' after 'start_hash'. +/// Creates the next Entry `num_hashes` after `start_hash`. pub fn create_entry(start_hash: &Hash, cur_hashes: u64, events: Vec) -> Entry { let num_hashes = cur_hashes + if events.is_empty() { 0 } else { 1 }; let id = next_hash(start_hash, 0, &events); @@ -67,7 +67,7 @@ pub fn create_entry(start_hash: &Hash, cur_hashes: u64, events: Vec) -> E } } -/// Creates the next Tick Entry 'num_hashes' after 'start_hash'. +/// Creates the next Tick Entry `num_hashes` after `start_hash`. pub fn create_entry_mut(start_hash: &mut Hash, cur_hashes: &mut u64, events: Vec) -> Entry { let entry = create_entry(start_hash, *cur_hashes, events); *start_hash = entry.id; @@ -75,7 +75,7 @@ pub fn create_entry_mut(start_hash: &mut Hash, cur_hashes: &mut u64, events: Vec entry } -/// Creates the next Tick Entry 'num_hashes' after 'start_hash'. +/// Creates the next Tick Entry `num_hashes` after `start_hash`. pub fn next_tick(start_hash: &Hash, num_hashes: u64) -> Entry { Entry { num_hashes,