Skip to content

Commit c4172f2

Browse files
Introduce a NoOp definition set transformer
1 parent 9c8a29f commit c4172f2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/transformers.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ pub type TransformerFnOnce<T> = Box<dyn FnOnce(T) -> T>;
2424

2525
pub type TransformerFnMut<T> = Box<dyn FnMut(T) -> T>;
2626

27+
#[derive(Default, Debug)]
28+
pub struct NoOp {}
29+
impl DefinitionSetTransformer for NoOp {
30+
fn transform<'a>(&self, defs: &'a mut ClusterDefinitionSet) -> &'a mut ClusterDefinitionSet {
31+
defs
32+
}
33+
}
34+
2735
#[derive(Default, Debug)]
2836
pub struct StripCmqKeysFromPolicies {}
2937

@@ -78,7 +86,9 @@ impl From<Vec<&str>> for TransformationChain {
7886
"drop_empty_policies" => {
7987
vec.push(Box::new(DropEmptyPolicies::default()));
8088
}
81-
_ => (),
89+
_ => {
90+
vec.push(Box::new(NoOp::default()));
91+
}
8292
}
8393
}
8494
TransformationChain { chain: vec }

0 commit comments

Comments
 (0)