From 72aa9515f385f1a2d30802a50ef851fcf92c2e6a Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Wed, 17 Jan 2024 10:54:30 +0100 Subject: [PATCH] Remove duplicate impl --- crates/polars-plan/src/dsl/arithmetic.rs | 5 ++++- crates/polars-plan/src/dsl/mod.rs | 6 ------ crates/polars-plan/src/dsl/unary.rs | 1 - 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/crates/polars-plan/src/dsl/arithmetic.rs b/crates/polars-plan/src/dsl/arithmetic.rs index c192476cee3b..ccc7f7a6f1d9 100644 --- a/crates/polars-plan/src/dsl/arithmetic.rs +++ b/crates/polars-plan/src/dsl/arithmetic.rs @@ -1,4 +1,6 @@ -use std::ops::{Add, Div, Mul, Neg, Rem, Sub}; +#[cfg(feature = "negate")] +use std::ops::Neg; +use std::ops::{Add, Div, Mul, Rem, Sub}; use super::*; @@ -43,6 +45,7 @@ impl Rem for Expr { } } +#[cfg(feature = "negate")] impl Neg for Expr { type Output = Expr; diff --git a/crates/polars-plan/src/dsl/mod.rs b/crates/polars-plan/src/dsl/mod.rs index 69ffc42470d7..224115e35286 100644 --- a/crates/polars-plan/src/dsl/mod.rs +++ b/crates/polars-plan/src/dsl/mod.rs @@ -162,12 +162,6 @@ impl Expr { binary_expr(self, Operator::LtEq, other.into()) } - /// Negate `Expr`. - #[allow(clippy::should_implement_trait)] - pub fn not(self) -> Expr { - self.map_private(BooleanFunction::Not.into()) - } - /// Rename Column. pub fn alias(self, name: &str) -> Expr { Expr::Alias(Box::new(self), Arc::from(name)) diff --git a/crates/polars-plan/src/dsl/unary.rs b/crates/polars-plan/src/dsl/unary.rs index d1711e97cf5d..89f295d065f3 100644 --- a/crates/polars-plan/src/dsl/unary.rs +++ b/crates/polars-plan/src/dsl/unary.rs @@ -6,7 +6,6 @@ use crate::dsl::Expr; impl Not for Expr { type Output = Expr; - #[allow(clippy::should_implement_trait)] fn not(self) -> Expr { self.map_private(BooleanFunction::Not.into()) }