@@ -24,10 +24,10 @@ pub type TransformerFnOnce<T> = Box<dyn FnOnce(T) -> T>;
2424
2525pub type TransformerFnMut < T > = Box < dyn FnMut ( T ) -> T > ;
2626
27- #[ derive( Default ) ]
28- pub struct StripCmqPolicies { }
27+ #[ derive( Default , Debug ) ]
28+ pub struct StripCmqKeysFromPolicies { }
2929
30- impl DefinitionSetTransformer for StripCmqPolicies {
30+ impl DefinitionSetTransformer for StripCmqKeysFromPolicies {
3131 fn transform < ' a > ( & self , defs : & ' a mut ClusterDefinitionSet ) -> & ' a mut ClusterDefinitionSet {
3232 let pf = Box :: new ( |p : Policy | p. without_cmq_keys ( ) ) ;
3333 let matched_policies = defs. update_policies ( pf) ;
@@ -41,7 +41,7 @@ impl DefinitionSetTransformer for StripCmqPolicies {
4141 }
4242}
4343
44- #[ derive( Default ) ]
44+ #[ derive( Default , Debug ) ]
4545pub struct DropEmptyPolicies { }
4646
4747impl DefinitionSetTransformer for DropEmptyPolicies {
@@ -70,10 +70,11 @@ pub struct TransformationChain {
7070impl From < Vec < & str > > for TransformationChain {
7171 fn from ( names : Vec < & str > ) -> Self {
7272 let mut vec: Vec < Box < dyn DefinitionSetTransformer > > = Vec :: new ( ) ;
73+ dbg ! ( & names) ;
7374 for name in names {
7475 match name {
75- "strip_cmq_policies " => {
76- vec. push ( Box :: new ( StripCmqPolicies :: default ( ) ) ) ;
76+ "strip_cmq_keys_from_policies " => {
77+ vec. push ( Box :: new ( StripCmqKeysFromPolicies :: default ( ) ) ) ;
7778 }
7879 "drop_empty_policies" => {
7980 vec. push ( Box :: new ( DropEmptyPolicies :: default ( ) ) ) ;
@@ -107,4 +108,8 @@ impl TransformationChain {
107108
108109 defs
109110 }
111+
112+ pub fn len ( & self ) -> usize {
113+ self . chain . len ( )
114+ }
110115}
0 commit comments