@@ -21,8 +21,8 @@ use crate::miniscript::ScriptContext;
2121use crate :: prelude:: * ;
2222use crate :: util:: MsKeyBuilder ;
2323use crate :: {
24- errstr, expression, script_num_size, AbsLockTime , Error , ForEachKey , Miniscript , MiniscriptKey ,
25- Terminal , ToPublicKey , TranslateErr , TranslatePk , Translator ,
24+ errstr, expression, script_num_size, AbsLockTime , Error , Miniscript , MiniscriptKey , Terminal ,
25+ ToPublicKey , TranslateErr , TranslatePk , Translator ,
2626} ;
2727
2828impl < Pk : MiniscriptKey , Ctx : ScriptContext > Terminal < Pk , Ctx > {
6464}
6565
6666impl < Pk : MiniscriptKey , Ctx : ScriptContext > Terminal < Pk , Ctx > {
67- pub ( super ) fn real_for_each_key < ' a , F : FnMut ( & ' a Pk ) -> bool > ( & ' a self , pred : & mut F ) -> bool {
68- match * self {
69- Terminal :: PkK ( ref p) => pred ( p) ,
70- Terminal :: PkH ( ref p) => pred ( p) ,
71- Terminal :: RawPkH ( ..)
72- | Terminal :: After ( ..)
73- | Terminal :: Older ( ..)
74- | Terminal :: Sha256 ( ..)
75- | Terminal :: Hash256 ( ..)
76- | Terminal :: Ripemd160 ( ..)
77- | Terminal :: Hash160 ( ..)
78- | Terminal :: True
79- | Terminal :: False => true ,
80- Terminal :: Alt ( ref sub)
81- | Terminal :: Swap ( ref sub)
82- | Terminal :: Check ( ref sub)
83- | Terminal :: DupIf ( ref sub)
84- | Terminal :: Verify ( ref sub)
85- | Terminal :: NonZero ( ref sub)
86- | Terminal :: ZeroNotEqual ( ref sub) => sub. real_for_each_key ( pred) ,
87- Terminal :: AndV ( ref left, ref right)
88- | Terminal :: AndB ( ref left, ref right)
89- | Terminal :: OrB ( ref left, ref right)
90- | Terminal :: OrD ( ref left, ref right)
91- | Terminal :: OrC ( ref left, ref right)
92- | Terminal :: OrI ( ref left, ref right) => {
93- left. real_for_each_key ( & mut * pred) && right. real_for_each_key ( pred)
94- }
95- Terminal :: AndOr ( ref a, ref b, ref c) => {
96- a. real_for_each_key ( & mut * pred)
97- && b. real_for_each_key ( & mut * pred)
98- && c. real_for_each_key ( pred)
99- }
100- Terminal :: Thresh ( _, ref subs) => subs. iter ( ) . all ( |sub| sub. real_for_each_key ( pred) ) ,
101- Terminal :: Multi ( _, ref keys) | Terminal :: MultiA ( _, ref keys) => keys. iter ( ) . all ( pred) ,
102- }
103- }
104-
10567 pub ( super ) fn real_translate_pk < Q , CtxQ , T , E > (
10668 & self ,
10769 t : & mut T ,
@@ -250,12 +212,6 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> Terminal<Pk, Ctx> {
250212 }
251213}
252214
253- impl < Pk : MiniscriptKey , Ctx : ScriptContext > ForEachKey < Pk > for Terminal < Pk , Ctx > {
254- fn for_each_key < ' a , F : FnMut ( & ' a Pk ) -> bool > ( & ' a self , mut pred : F ) -> bool {
255- self . real_for_each_key ( & mut pred)
256- }
257- }
258-
259215impl < Pk : MiniscriptKey , Ctx : ScriptContext > fmt:: Debug for Terminal < Pk , Ctx > {
260216 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
261217 f. write_str ( "[" ) ?;
0 commit comments