Skip to content

Commit 13b0cac

Browse files
committed
refactor(cubesql): Remove unnecessary Vec+Box for rules
1 parent 6fad670 commit 13b0cac

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

rust/cubesql/cubesql/src/compile/rewrite/rewriter.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -473,20 +473,16 @@ impl Rewriter {
473473
eval_stable_functions: bool,
474474
) -> Vec<CubeRewrite> {
475475
let sql_push_down = Self::sql_push_down_enabled();
476-
let rules: Vec<Box<dyn RewriteRules>> = vec![
477-
Box::new(MemberRules::new(
478-
meta_context.clone(),
479-
config_obj.clone(),
480-
sql_push_down,
481-
)),
482-
Box::new(FilterRules::new(
476+
let rules: &[&dyn RewriteRules] = &[
477+
&MemberRules::new(meta_context.clone(), config_obj.clone(), sql_push_down),
478+
&FilterRules::new(
483479
meta_context.clone(),
484480
config_obj.clone(),
485481
eval_stable_functions,
486-
)),
487-
Box::new(DateRules::new(config_obj.clone())),
488-
Box::new(OrderRules::new()),
489-
Box::new(CommonRules::new(config_obj.clone())),
482+
),
483+
&DateRules::new(config_obj.clone()),
484+
&OrderRules::new(),
485+
&CommonRules::new(config_obj.clone()),
490486
];
491487
let mut rewrites = Vec::new();
492488
for r in rules {

0 commit comments

Comments
 (0)