Skip to content

Commit

Permalink
chore: remove unused rust code (#883)
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennebacher authored Mar 2, 2024
1 parent cf52862 commit b6635f4
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 115 deletions.
78 changes: 0 additions & 78 deletions src/rust/src/lazy/dsl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2698,84 +2698,6 @@ pub fn make_rolling_options(
})
}

// #[derive(Clone, Debug)]
// pub struct When {
// predicate: Expr,
// }

// #[derive(Clone, Debug)]
// pub struct Then {
// predicate: Expr,
// then: Expr,
// }

// #[derive(Clone)]
// pub struct ChainWhen(dsl::ChainWhen);

// #[extendr]
// impl WhenThenThen {
// pub fn when(&self, predicate: &RPolarsExpr) -> WhenThenThen {
// Self(self.0.clone().when(predicate.0.clone()))
// }
// pub fn then(&self, expr: &RPolarsExpr) -> WhenThenThen {
// Self(self.0.clone().then(expr.0.clone()))
// }
// pub fn otherwise(&self, expr: &RPolarsExpr) -> RPolarsExpr {
// self.0.clone().otherwise(expr.0.clone()).into()
// }

// pub fn print(&self) {
// rprintln!("Polars WhenThenThen");
// }
// }

// #[derive(Clone)]
// pub struct ChainThen(dsl::ChainThen);

// #[extendr]
// impl Then {
// pub fn when(&self, predicate: &RPolarsExpr) -> WhenThenThen {
// let e = dsl::when(self.predicate.0.clone())
// .then(self.then.0.clone())
// .when(predicate.0.clone());
// WhenThenThen(e)
// }

// pub fn otherwise(&self, expr: &RPolarsExpr) -> RPolarsExpr {
// dsl::ternary_expr(
// self.predicate.0.clone(),
// self.then.0.clone(),
// expr.0.clone(),
// )
// .into()
// }

// pub fn print(&self) {
// rprintln!("{:?}", self);
// }
// }

// #[extendr]
// impl When {
// #[allow(clippy::self_named_constructors)]
// pub fn when(predicate: &RPolarsExpr) -> When {
// When {
// predicate: predicate.clone(),
// }
// }

// pub fn then(&self, expr: &RPolarsExpr) -> WhenThen {
// WhenThen {
// predicate: self.predicate.clone(),
// then: expr.clone(),
// }
// }

// pub fn print(&self) {
// rprintln!("{:?}", self);
// }
// }

#[extendr]
pub fn internal_wrap_e(robj: Robj, str_to_lit: Robj) -> RResult<RPolarsExpr> {
if robj_to!(bool, str_to_lit)? {
Expand Down
2 changes: 0 additions & 2 deletions src/rust/src/lazy/meta.rs

This file was deleted.

35 changes: 0 additions & 35 deletions src/rust/src/lazy/mod.rs
Original file line number Diff line number Diff line change
@@ -1,42 +1,7 @@
//mod apply;
//pub mod dataframe;
use extendr_api::*;
pub mod dataframe;
pub mod dsl;
pub mod whenthen;
//#[cfg(feature = "meta")]
//mod meta;
//pub mod utils;

//pub use apply::*;
//use dsl::*;
//use polars_lazy::prelude::*;

// pub(crate) trait ToExprs {
// fn to_exprs(self) -> Vec<Expr>;
// }

// impl ToExprs for Vec<PyExpr> {
// fn to_exprs(self) -> Vec<Expr> {
// // Safety
// // repr is transparent
// // and has only got one inner field`
// unsafe { std::mem::transmute(self) }
// }
// }

// pub(crate) trait ToPyExprs {
// fn to_pyexprs(self) -> Vec<PyExpr>;
// }

// impl ToPyExprs for Vec<Expr> {
// fn to_pyexprs(self) -> Vec<PyExpr> {
// // Safety
// // repr is transparent
// // and has only got one inner field`
// unsafe { std::mem::transmute(self) }
// }
// }

extendr_module! {
mod lazy;
Expand Down

0 comments on commit b6635f4

Please sign in to comment.