Wrap CompactTarget impl block in temporary module

`rustfmt` is unable to format macro calls so instead we wrap the impl
blocks in a module to enable formatting in the next commit.
This commit is contained in:
Tobin C. Harding 2024-08-12 20:16:12 +10:00
parent 578143c09e
commit 9c4a629659
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 4 additions and 0 deletions

View File

@ -355,6 +355,9 @@ impl CompactTarget {
pub fn to_consensus(self) -> u32 { self.0 }
}
mod tmp {
use super::*;
impl CompactTarget {
/// Creates a `CompactTarget` from a prefixed hex string.
pub fn from_hex(s: &str) -> Result<Self, PrefixedHexError> {
@ -444,6 +447,7 @@ impl CompactTarget {
CompactTarget::from_next_work_required(bits, timespan.into(), params)
}
}
}
impl From<CompactTarget> for Target {
fn from(c: CompactTarget) -> Self { Target::from_compact(c) }