Currently, we use None to represent an optimizing rule to be recursively applied to its children.
And we use Some(TopDown) and Some(BottomUp) to represent a rule can be directly applied to the child node.
The None usage can be directly replaced by introducing a new product type ApplyOrder::Recursive.
This can
- remove the usage of nested pattern matching,
- better comment the code ,
- and help the rust compiler to better optimize the code.
This is a follow-up of #4618.
Describe the solution you'd like
pub enum ApplyOrder {
/// ...
TopDown,
/// ...
BottomUp,
/// ...
Recursive,
}
Describe alternatives you've considered
We could not do this.
Additional context
Add any other context or screenshots about the feature request here.
Currently, we use
Noneto represent an optimizing rule to be recursively applied to its children.And we use
Some(TopDown)andSome(BottomUp)to represent a rule can be directly applied to the child node.The
Noneusage can be directly replaced by introducing a new product typeApplyOrder::Recursive.This can
This is a follow-up of #4618.
Describe the solution you'd like
Describe alternatives you've considered
We could not do this.
Additional context
Add any other context or screenshots about the feature request here.