ctsk commented on code in PR #15051: URL: https://github.com/apache/datafusion/pull/15051#discussion_r1983500136
########## datafusion/optimizer/src/optimizer.rs: ########## @@ -304,43 +286,29 @@ impl TreeNodeRewriter for Rewriter<'_> { fn f_down(&mut self, node: LogicalPlan) -> Result<Transformed<LogicalPlan>> { if self.apply_order == ApplyOrder::TopDown { - optimize_plan_node(node, self.rule, self.config) + { + let rule: &dyn OptimizerRule = self.rule; + let config: &dyn OptimizerConfig = self.config; + rule.rewrite(node, config) + } Review Comment: I'd just write ```rust self.rule.rewrite(node, self.config) ``` :) ########## datafusion/optimizer/src/optimizer.rs: ########## @@ -386,7 +354,10 @@ impl Optimizer { &mut Rewriter::new(apply_order, rule.as_ref(), config), ), // rule handles recursion itself - None => optimize_plan_node(new_plan, rule.as_ref(), config), + None => { + let rule: &dyn OptimizerRule = rule.as_ref(); Review Comment: Maybe unnecessary? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org