Skip to content

Commit f3087f0

Browse files
committed
u
Signed-off-by: Joe Isaacs <[email protected]>
1 parent 645a78a commit f3087f0

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

vortex-array/src/expr/transform/rules.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::expr::{Expression, ExpressionView, VTable};
1919
/// # Type Parameters
2020
/// * `V` - The VTable type this rule applies to. The rule will only be invoked for expressions
2121
/// with this vtable type, providing compile-time type safety.
22-
pub trait ReduceRule<V: VTable, C: Context>: Send + Sync {
22+
pub trait ReduceRule<V: VTable, C: RewriteContext>: Send + Sync {
2323
/// Try to rewrite an expression.
2424
///
2525
/// # Arguments
@@ -42,7 +42,7 @@ pub trait ReduceRule<V: VTable, C: Context>: Send + Sync {
4242
/// # Type Parameters
4343
/// * `V` - The VTable type this rule applies to. The rule will only be invoked for expressions
4444
/// with this vtable type, providing compile-time type safety.
45-
pub trait ParentReduceRule<V: VTable, C: Context>: Send + Sync {
45+
pub trait ParentReduceRule<V: VTable, C: RewriteContext>: Send + Sync {
4646
/// Try to rewrite an expression based on its parent.
4747
///
4848
/// # Arguments
@@ -63,13 +63,8 @@ pub trait ParentReduceRule<V: VTable, C: Context>: Send + Sync {
6363
) -> VortexResult<Option<Expression>>;
6464
}
6565

66-
pub trait Context {}
67-
68-
// Blanket implementation: all references to Context implementors also implement Context
69-
impl<T: Context + ?Sized> Context for &T {}
70-
7166
/// Base context for rewrite rules.
72-
pub trait RewriteContext: Context {}
67+
pub trait RewriteContext {}
7368

7469
// Blanket implementation: all references to RewriteContext implementors also implement RewriteContext
7570
impl<T: RewriteContext + ?Sized> RewriteContext for &T {}
@@ -86,8 +81,6 @@ pub trait TypedRewriteContext: RewriteContext {
8681
#[derive(Debug, Default)]
8782
pub struct EmptyRewriteContext;
8883

89-
impl Context for EmptyRewriteContext {}
90-
9184
impl RewriteContext for EmptyRewriteContext {}
9285

9386
/// Simple implementation that supports both RewriteContext and TypedRewriteContext.
@@ -96,8 +89,6 @@ pub struct RootRewriteContext<'a> {
9689
pub dtype: &'a DType,
9790
}
9891

99-
impl<'a> Context for RootRewriteContext<'a> {}
100-
10192
impl<'a> RewriteContext for RootRewriteContext<'a> {}
10293

10394
impl<'a> TypedRewriteContext for RootRewriteContext<'a> {

0 commit comments

Comments
 (0)