From 25d1472924babbddbddf7a3729435b767388b61c Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 9 Aug 2022 14:26:38 +1000 Subject: [PATCH] Move new to top of impl block To ease reading, put the `new` method at the top of the impl block. Improve rustdocs while we do it. --- src/util/bip158.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/util/bip158.rs b/src/util/bip158.rs index 513c5086..5920d0d1 100644 --- a/src/util/bip158.rs +++ b/src/util/bip158.rs @@ -110,17 +110,17 @@ impl FilterHash { } impl BlockFilter { + /// Creates a new filter from pre-computed data. + pub fn new (content: &[u8]) -> BlockFilter { + BlockFilter { content: content.to_vec() } + } + /// compute this filter's id in a chain of filters pub fn filter_header(&self, previous_filter_header: &FilterHeader) -> FilterHeader { let filter_hash = FilterHash::hash(self.content.as_slice()); filter_hash.filter_header(previous_filter_header) } - /// create a new filter from pre-computed data - pub fn new (content: &[u8]) -> BlockFilter { - BlockFilter { content: content.to_vec() } - } - /// Compute a SCRIPT_FILTER that contains spent and output scripts pub fn new_script_filter(block: &Block, script_for_coin: M) -> Result where M: Fn(&OutPoint) -> Result {