From 702ba8859ab02081916bc2c1d57a6cf7ed51d80c Mon Sep 17 00:00:00 2001 From: eitsupi <50911393+eitsupi@users.noreply.github.com> Date: Fri, 1 Mar 2024 21:36:50 +0900 Subject: [PATCH] refactor: remove unused code (#876) --- src/rust/src/concat.rs | 1 - src/rust/src/concurrent.rs | 1 - src/rust/src/info.rs | 1 - src/rust/src/lazy/dataframe.rs | 1 - src/rust/src/lazy/dsl.rs | 2 +- src/rust/src/rdataframe/mod.rs | 2 +- src/rust/src/rdataframe/read_csv.rs | 2 +- src/rust/src/rdataframe/read_ndjson.rs | 2 +- src/rust/src/rlib.rs | 1 - src/rust/src/series.rs | 3 +-- src/rust/src/utils/extendr_concurrent.rs | 1 - 11 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/rust/src/concat.rs b/src/rust/src/concat.rs index 9dd2feca8..22e9e3c1d 100644 --- a/src/rust/src/concat.rs +++ b/src/rust/src/concat.rs @@ -5,7 +5,6 @@ use crate::series::RPolarsSeries; use extendr_api::prelude::*; use polars::lazy::dsl; use polars::prelude as pl; -use polars_core; use polars_core::functions as pl_functions; use std::result::Result; diff --git a/src/rust/src/concurrent.rs b/src/rust/src/concurrent.rs index 92b25cae8..56a1bc01d 100644 --- a/src/rust/src/concurrent.rs +++ b/src/rust/src/concurrent.rs @@ -8,7 +8,6 @@ use polars::prelude as pl; use crate::rdataframe::RPolarsSeries; use crate::rpolarserr::*; use extendr_api::prelude::*; -use extendr_api::Conversions; use std::result::Result; // define any possible signature of R lambdas diff --git a/src/rust/src/info.rs b/src/rust/src/info.rs index c69653f4e..53d7c2f6e 100644 --- a/src/rust/src/info.rs +++ b/src/rust/src/info.rs @@ -1,5 +1,4 @@ use extendr_api::prelude::*; -use polars; #[extendr] fn cargo_rpolars_feature_info() -> List { diff --git a/src/rust/src/lazy/dataframe.rs b/src/rust/src/lazy/dataframe.rs index 8bed593dd..7cd3d1ec8 100644 --- a/src/rust/src/lazy/dataframe.rs +++ b/src/rust/src/lazy/dataframe.rs @@ -3,7 +3,6 @@ use crate::concurrent::{ }; use crate::conversion::strings_to_smartstrings; -use crate::lazy::dsl::RPolarsExpr; use crate::lazy::dsl::*; use crate::rdataframe::RPolarsDataFrame as RDF; diff --git a/src/rust/src/lazy/dsl.rs b/src/rust/src/lazy/dsl.rs index 6acfe0a9b..6526022fb 100644 --- a/src/rust/src/lazy/dsl.rs +++ b/src/rust/src/lazy/dsl.rs @@ -13,7 +13,7 @@ use crate::utils::wrappers::null_to_opt; use crate::utils::{r_error_list, r_ok_list, r_result_list, robj_to_binary_vec}; use crate::utils::{try_f64_into_i64, try_f64_into_u32, try_f64_into_usize}; use crate::CONFIG; -use extendr_api::{extendr, prelude::*, rprintln, Deref, DerefMut, Rinternals}; +use extendr_api::{extendr, prelude::*, rprintln, Deref, DerefMut}; use pl::PolarsError as pl_error; use pl::{ BinaryNameSpaceImpl, Duration, DurationMethods, IntoSeries, RollingGroupOptions, SetOperation, diff --git a/src/rust/src/rdataframe/mod.rs b/src/rust/src/rdataframe/mod.rs index 493456906..501626fa6 100644 --- a/src/rust/src/rdataframe/mod.rs +++ b/src/rust/src/rdataframe/mod.rs @@ -1,4 +1,4 @@ -use extendr_api::{extendr, prelude::*, rprintln, Rinternals}; +use extendr_api::{extendr, prelude::*, rprintln}; use polars::prelude::{self as pl, IntoLazy, SerWriter}; use std::result::Result; pub mod read_csv; diff --git a/src/rust/src/rdataframe/read_csv.rs b/src/rust/src/rdataframe/read_csv.rs index c6e0d95d7..53201a469 100644 --- a/src/rust/src/rdataframe/read_csv.rs +++ b/src/rust/src/rdataframe/read_csv.rs @@ -9,7 +9,7 @@ use polars::io::RowIndex; //use crate::utils::wrappers::*; use crate::utils::wrappers::{null_to_opt, Wrap}; -use extendr_api::{extendr, prelude::*, Rinternals}; +use extendr_api::{extendr, prelude::*}; use polars::prelude as pl; use std::result::Result; diff --git a/src/rust/src/rdataframe/read_ndjson.rs b/src/rust/src/rdataframe/read_ndjson.rs index c6fe2a736..186e5421b 100644 --- a/src/rust/src/rdataframe/read_ndjson.rs +++ b/src/rust/src/rdataframe/read_ndjson.rs @@ -6,7 +6,7 @@ use crate::rpolarserr::*; use polars::io::RowIndex; //use crate::utils::wrappers::*; -use extendr_api::{extendr, prelude::*, Rinternals}; +use extendr_api::{extendr, prelude::*}; use polars::prelude as pl; use polars::prelude::LazyFileListReader; use std::result::Result; diff --git a/src/rust/src/rlib.rs b/src/rust/src/rlib.rs index 8a69d2ec0..c4894d7ad 100644 --- a/src/rust/src/rlib.rs +++ b/src/rust/src/rlib.rs @@ -1,7 +1,6 @@ use crate::lazy::dsl::{RPolarsExpr, RPolarsProtoExprArray}; use crate::rdataframe::RPolarsDataFrame; use crate::robj_to; -use crate::rpolarserr::{rdbg, RResult}; use crate::series::RPolarsSeries; use crate::utils::extendr_concurrent::{ParRObj, ThreadCom}; use crate::utils::robj_to_rchoice; diff --git a/src/rust/src/series.rs b/src/rust/src/series.rs index bcfcd5caf..89ceae3ff 100644 --- a/src/rust/src/series.rs +++ b/src/rust/src/series.rs @@ -17,7 +17,7 @@ use crate::rpolarserr::RResult; use crate::utils::wrappers::null_to_opt; use crate::utils::{r_error_list, r_result_list}; -use extendr_api::{extendr, prelude::*, rprintln, Rinternals}; +use extendr_api::{extendr, prelude::*, rprintln}; use pl::SeriesMethods; use polars::datatypes::*; use polars::prelude as pl; @@ -25,7 +25,6 @@ use polars::prelude::ArgAgg; use polars::prelude::IntoSeries; pub const R_INT_NA_ENC: i32 = -2147483648; use crate::rpolarserr::polars_to_rpolars_err; -use std::convert::TryInto; use std::result::Result; #[derive(Debug, Clone)] diff --git a/src/rust/src/utils/extendr_concurrent.rs b/src/rust/src/utils/extendr_concurrent.rs index 64ca6c183..7ce95ab8d 100644 --- a/src/rust/src/utils/extendr_concurrent.rs +++ b/src/rust/src/utils/extendr_concurrent.rs @@ -4,7 +4,6 @@ use extendr_api::prelude::*; use std::sync::RwLock; use std::thread; -use flume; use flume::{Receiver, Sender}; pub use state::InitCell;