Skip to content

Commit c8d3b9a

Browse files
committed
fix formatting in big example
1 parent bc47538 commit c8d3b9a

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

examples/big.rs

+18-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: CC0-1.0
2-
//! This is not an example and will surely panic if executed, the purpose of this is using the
2+
//! This is not an example and will surely panic if executed, the purpose of this is using the
33
//! compiled binary with tools like `cargo bloat` that cannot work with libraries.
44
//!
55
//! Ideal properties:
@@ -9,9 +9,17 @@
99
//! * Use results so that calls are not stripped out.
1010
//!
1111
12-
use std::{collections::HashMap, str::FromStr};
12+
use std::collections::HashMap;
13+
use std::str::FromStr;
14+
1315
use bitcoin::{ecdsa, XOnlyPublicKey};
14-
use miniscript::{descriptor::Wsh, policy::{Concrete, Liftable}, psbt::PsbtExt, translate_hash_fail, DefiniteDescriptorKey, Descriptor, DescriptorPublicKey, MiniscriptKey, TranslatePk, Translator};
16+
use miniscript::descriptor::Wsh;
17+
use miniscript::policy::{Concrete, Liftable};
18+
use miniscript::psbt::PsbtExt;
19+
use miniscript::{
20+
translate_hash_fail, DefiniteDescriptorKey, Descriptor, DescriptorPublicKey, MiniscriptKey,
21+
TranslatePk, Translator,
22+
};
1523
use secp256k1::Secp256k1;
1624
fn main() {
1725
let empty = "".to_string();
@@ -24,7 +32,11 @@ fn main() {
2432
use_descriptor(Descriptor::<bitcoin::PublicKey>::from_str(&i).unwrap());
2533
use_descriptor(Descriptor::<String>::from_str(&i).unwrap());
2634

27-
let a = d.at_derivation_index(0).unwrap().address(bitcoin::Network::Bitcoin).unwrap();
35+
let a = d
36+
.at_derivation_index(0)
37+
.unwrap()
38+
.address(bitcoin::Network::Bitcoin)
39+
.unwrap();
2840
println!("{}", a);
2941

3042
let secp = Secp256k1::new();
@@ -51,7 +63,7 @@ fn main() {
5163
let pol = Concrete::<String>::from_str(&i).unwrap();
5264
let desc = pol.compile_tr(Some("UNSPENDABLE_KEY".to_string())).unwrap();
5365
println!("{}", desc);
54-
let pk_map =HashMap::new();
66+
let pk_map = HashMap::new();
5567
let mut t = StrPkTranslator { pk_map };
5668
let real_desc = desc.translate_pk(&mut t).unwrap();
5769
println!("{}", real_desc);
@@ -66,7 +78,6 @@ fn use_descriptor<K: MiniscriptKey>(d: Descriptor<K>) {
6678
println!("{:?}", d.sanity_check());
6779
}
6880

69-
7081
struct StrPkTranslator {
7182
pk_map: HashMap<String, XOnlyPublicKey>,
7283
}
@@ -79,4 +90,4 @@ impl Translator<String, XOnlyPublicKey, ()> for StrPkTranslator {
7990
// We don't need to implement these methods as we are not using them in the policy.
8091
// Fail if we encounter any hash fragments. See also translate_hash_clone! macro.
8192
translate_hash_fail!(String, XOnlyPublicKey, ());
82-
}
93+
}

0 commit comments

Comments
 (0)