Skip to content

Commit 23897d1

Browse files
committed
Put the two Miniscript impl blocks together
There are now two impl blocks for `Miniscript` with different generics, put one directly under the other. To match the diff this should be said "move trait impls below the second Miniscript impl block".
1 parent 5fd22a6 commit 23897d1

File tree

1 file changed

+53
-53
lines changed

1 file changed

+53
-53
lines changed

src/miniscript/mod.rs

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -253,59 +253,6 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx> {
253253
}
254254
}
255255

256-
/// `PartialOrd` of `Miniscript` must depend only on node and not the type information.
257-
///
258-
/// The type information and extra properties are implied by the AST.
259-
impl<Pk: MiniscriptKey, Ctx: ScriptContext> PartialOrd for Miniscript<Pk, Ctx> {
260-
fn partial_cmp(&self, other: &Miniscript<Pk, Ctx>) -> Option<cmp::Ordering> {
261-
Some(self.node.cmp(&other.node))
262-
}
263-
}
264-
265-
/// `Ord` of `Miniscript` must depend only on node and not the type information.
266-
///
267-
/// The type information and extra properties are implied by the AST.
268-
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Ord for Miniscript<Pk, Ctx> {
269-
fn cmp(&self, other: &Miniscript<Pk, Ctx>) -> cmp::Ordering {
270-
self.node.cmp(&other.node)
271-
}
272-
}
273-
274-
/// `PartialEq` of `Miniscript` must depend only on node and not the type information.
275-
///
276-
/// The type information and extra properties are implied by the AST.
277-
impl<Pk: MiniscriptKey, Ctx: ScriptContext> PartialEq for Miniscript<Pk, Ctx> {
278-
fn eq(&self, other: &Miniscript<Pk, Ctx>) -> bool {
279-
self.node.eq(&other.node)
280-
}
281-
}
282-
283-
/// `Eq` of `Miniscript` must depend only on node and not the type information.
284-
///
285-
/// The type information and extra properties are implied by the AST.
286-
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Eq for Miniscript<Pk, Ctx> {}
287-
288-
/// `Hash` of `Miniscript` must depend only on node and not the type information.
289-
///
290-
/// The type information and extra properties are implied by the AST.
291-
impl<Pk: MiniscriptKey, Ctx: ScriptContext> hash::Hash for Miniscript<Pk, Ctx> {
292-
fn hash<H: hash::Hasher>(&self, state: &mut H) {
293-
self.node.hash(state);
294-
}
295-
}
296-
297-
impl<Pk: MiniscriptKey, Ctx: ScriptContext> fmt::Debug for Miniscript<Pk, Ctx> {
298-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
299-
write!(f, "{:?}", self.node)
300-
}
301-
}
302-
303-
impl<Pk: MiniscriptKey, Ctx: ScriptContext> fmt::Display for Miniscript<Pk, Ctx> {
304-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
305-
write!(f, "{}", self.node)
306-
}
307-
}
308-
309256
impl<Ctx: ScriptContext> Miniscript<Ctx::Key, Ctx> {
310257
/// Attempt to parse an insane(scripts don't clear sanity checks)
311258
/// script into a Miniscript representation.
@@ -385,6 +332,59 @@ impl<Ctx: ScriptContext> Miniscript<Ctx::Key, Ctx> {
385332
}
386333
}
387334

335+
/// `PartialOrd` of `Miniscript` must depend only on node and not the type information.
336+
///
337+
/// The type information and extra properties are implied by the AST.
338+
impl<Pk: MiniscriptKey, Ctx: ScriptContext> PartialOrd for Miniscript<Pk, Ctx> {
339+
fn partial_cmp(&self, other: &Miniscript<Pk, Ctx>) -> Option<cmp::Ordering> {
340+
Some(self.node.cmp(&other.node))
341+
}
342+
}
343+
344+
/// `Ord` of `Miniscript` must depend only on node and not the type information.
345+
///
346+
/// The type information and extra properties are implied by the AST.
347+
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Ord for Miniscript<Pk, Ctx> {
348+
fn cmp(&self, other: &Miniscript<Pk, Ctx>) -> cmp::Ordering {
349+
self.node.cmp(&other.node)
350+
}
351+
}
352+
353+
/// `PartialEq` of `Miniscript` must depend only on node and not the type information.
354+
///
355+
/// The type information and extra properties are implied by the AST.
356+
impl<Pk: MiniscriptKey, Ctx: ScriptContext> PartialEq for Miniscript<Pk, Ctx> {
357+
fn eq(&self, other: &Miniscript<Pk, Ctx>) -> bool {
358+
self.node.eq(&other.node)
359+
}
360+
}
361+
362+
/// `Eq` of `Miniscript` must depend only on node and not the type information.
363+
///
364+
/// The type information and extra properties are implied by the AST.
365+
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Eq for Miniscript<Pk, Ctx> {}
366+
367+
/// `Hash` of `Miniscript` must depend only on node and not the type information.
368+
///
369+
/// The type information and extra properties are implied by the AST.
370+
impl<Pk: MiniscriptKey, Ctx: ScriptContext> hash::Hash for Miniscript<Pk, Ctx> {
371+
fn hash<H: hash::Hasher>(&self, state: &mut H) {
372+
self.node.hash(state);
373+
}
374+
}
375+
376+
impl<Pk: MiniscriptKey, Ctx: ScriptContext> fmt::Debug for Miniscript<Pk, Ctx> {
377+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
378+
write!(f, "{:?}", self.node)
379+
}
380+
}
381+
382+
impl<Pk: MiniscriptKey, Ctx: ScriptContext> fmt::Display for Miniscript<Pk, Ctx> {
383+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
384+
write!(f, "{}", self.node)
385+
}
386+
}
387+
388388
impl<Pk: MiniscriptKey, Ctx: ScriptContext> ForEachKey<Pk> for Miniscript<Pk, Ctx> {
389389
fn for_each_key<'a, F: FnMut(&'a Pk) -> bool>(&'a self, mut pred: F) -> bool {
390390
for ms in self.pre_order_iter() {

0 commit comments

Comments
 (0)