Skip to content

Commit db0351e

Browse files
committed
Move Miniscript Hash impl underneath others
The `Hash` trait is related to PartialEq, Eq, PartialOrd, Ord - as such put it next to them.
1 parent 976068f commit db0351e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/miniscript/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,18 +95,18 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> PartialEq for Miniscript<Pk, Ctx> {
9595
/// by the ast.
9696
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Eq for Miniscript<Pk, Ctx> {}
9797

98-
impl<Pk: MiniscriptKey, Ctx: ScriptContext> fmt::Debug for Miniscript<Pk, Ctx> {
99-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
100-
write!(f, "{:?}", self.node)
101-
}
102-
}
103-
10498
impl<Pk: MiniscriptKey, Ctx: ScriptContext> hash::Hash for Miniscript<Pk, Ctx> {
10599
fn hash<H: hash::Hasher>(&self, state: &mut H) {
106100
self.node.hash(state);
107101
}
108102
}
109103

104+
impl<Pk: MiniscriptKey, Ctx: ScriptContext> fmt::Debug for Miniscript<Pk, Ctx> {
105+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
106+
write!(f, "{:?}", self.node)
107+
}
108+
}
109+
110110
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx> {
111111
/// Add type information(Type and Extdata) to Miniscript based on
112112
/// `AstElem` fragment. Dependent on display and clone because of Error

0 commit comments

Comments
 (0)