Skip to content

Commit dbf9a62

Browse files
committed
Combine Miniscript conversion and constructor blocks
Combine the two impl blocks that contain constructors and conversion functions. Refactor only, no logic changes.
1 parent 6c5db91 commit dbf9a62

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/miniscript/mod.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx> {
9595
phantom: PhantomData,
9696
}
9797
}
98+
99+
/// Extracts the `AstElem` representing the root of the miniscript
100+
pub fn into_inner(self) -> Terminal<Pk, Ctx> {
101+
self.node
102+
}
103+
104+
/// Get a reference to the inner `AstElem` representing the root of miniscript
105+
pub fn as_inner(&self) -> &Terminal<Pk, Ctx> {
106+
&self.node
107+
}
98108
}
99109

100110
/// `PartialOrd` of `Miniscript` must depend only on node and not the type information.
@@ -150,18 +160,6 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> fmt::Display for Miniscript<Pk, Ctx>
150160
}
151161
}
152162

153-
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx> {
154-
/// Extracts the `AstElem` representing the root of the miniscript
155-
pub fn into_inner(self) -> Terminal<Pk, Ctx> {
156-
self.node
157-
}
158-
159-
/// Get a reference to the inner `AstElem` representing the root of miniscript
160-
pub fn as_inner(&self) -> &Terminal<Pk, Ctx> {
161-
&self.node
162-
}
163-
}
164-
165163
impl<Ctx: ScriptContext> Miniscript<Ctx::Key, Ctx> {
166164
/// Attempt to parse an insane(scripts don't clear sanity checks)
167165
/// script into a Miniscript representation.

0 commit comments

Comments
 (0)