diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml index 7fd9006f4..ab2d8f0d8 100644 --- a/src/rust/Cargo.toml +++ b/src/rust/Cargo.toml @@ -36,7 +36,7 @@ opt-level = 3 # was 1 to support 1.66, but since 1.70 is needed anyway it does n opt-level = 3 [dependencies] -extendr-api = { version = "0.7.0", default-features = false, features = [ +extendr-api = { git = "https://github.com/extendr/extendr", rev = "0d0a525b59a1c07c16e0be3e16cabc513f471ced", default-features = false, features = [ "result_list", "serde", ] } diff --git a/src/rust/src/arrow_interop/mod.rs b/src/rust/src/arrow_interop/mod.rs index 2e3c38967..4c41213e8 100644 --- a/src/rust/src/arrow_interop/mod.rs +++ b/src/rust/src/arrow_interop/mod.rs @@ -3,7 +3,6 @@ pub mod to_rust; use polars_core::utils::arrow; use extendr_api::prelude::*; -use std::result::Result; #[derive(Debug)] pub enum RArrowArrayClass { @@ -14,7 +13,7 @@ pub enum RArrowArrayClass { impl TryFrom<&Robj> for RArrowArrayClass { type Error = extendr_api::Error; - fn try_from(robj: &Robj) -> extendr_api::Result { + fn try_from(robj: &Robj) -> Result { if robj.inherits("nanoarrow_array") { Ok(RArrowArrayClass::NanoArrowArray) } else if robj.inherits("Array") { @@ -42,11 +41,11 @@ impl RArrowArrayClass { } pub trait RPackage { - fn get_export_array_func(&self) -> Result; + fn get_export_array_func(&self) -> Result; } impl RPackage for ArrowRPackage { - fn get_export_array_func(&self) -> Result { + fn get_export_array_func(&self) -> Result { R!(r#" function(array, exportable_array, exportable_schema) { array$export_to_c(exportable_array, exportable_schema) @@ -55,7 +54,7 @@ impl RPackage for ArrowRPackage { } impl RPackage for NanoArrowRPackage { - fn get_export_array_func(&self) -> Result { + fn get_export_array_func(&self) -> Result { R!(r#" function(array, exportable_array, exportable_schema) { nanoarrow::nanoarrow_pointer_export( diff --git a/src/rust/src/conversion_r_to_s.rs b/src/rust/src/conversion_r_to_s.rs index 95098600c..f422d2441 100644 --- a/src/rust/src/conversion_r_to_s.rs +++ b/src/rust/src/conversion_r_to_s.rs @@ -154,7 +154,8 @@ fn recursive_robjname2series_tree(x: &Robj, name: &str) -> pl::PolarsResult { let rpolars_raw_list = list!(x) - .set_class(["rpolars_raw_list", "list"]).cloned() + .set_class(["rpolars_raw_list", "list"]) + .cloned() .map_err(|err| pl::polars_err!(ComputeError: err.to_string()))?; recursive_robjname2series_tree(&rpolars_raw_list.into_robj(), name) } diff --git a/src/rust/src/conversion_s_to_r.rs b/src/rust/src/conversion_s_to_r.rs index 98afe48cd..6823f1359 100644 --- a/src/rust/src/conversion_s_to_r.rs +++ b/src/rust/src/conversion_s_to_r.rs @@ -261,7 +261,7 @@ pub fn pl_series_to_list( }) .map(|mut robj| { robj.set_attrib("tzone", opt_tz.as_ref().map(|s| s.as_str()).unwrap_or("")) - .cloned() + .cloned() }) .expect("internal error: attr tzone failed") .map_err(|err| { diff --git a/src/rust/src/lazy/dataframe.rs b/src/rust/src/lazy/dataframe.rs index 77d565e15..c5de99f12 100644 --- a/src/rust/src/lazy/dataframe.rs +++ b/src/rust/src/lazy/dataframe.rs @@ -34,7 +34,6 @@ impl From for RPolarsLazyFrame { } } -use extendr_api::Result; #[extendr] impl RPolarsLazyFrame { fn print(&self) -> RResult { diff --git a/src/rust/src/lazy/dsl.rs b/src/rust/src/lazy/dsl.rs index b52f98c93..5a34226a7 100644 --- a/src/rust/src/lazy/dsl.rs +++ b/src/rust/src/lazy/dsl.rs @@ -55,7 +55,6 @@ impl From for RPolarsExpr { } } -use extendr_api::Result; #[extendr] impl RPolarsExpr { //constructors diff --git a/src/rust/src/rbackground.rs b/src/rust/src/rbackground.rs index 35b1f8a8c..06c792892 100644 --- a/src/rust/src/rbackground.rs +++ b/src/rust/src/rbackground.rs @@ -5,8 +5,8 @@ use crate::rpolarserr::{ extendr_to_rpolars_err, polars_to_rpolars_err, rdbg, RPolarsErr, RResult, Rctx, WithRctx, }; use extendr_api::{ - call, eval_string, extendr, extendr_module, list, pairlist, symbol::class_symbol, Attributes, - Conversions, Length, List, Operators, Pairlist, Rinternals, Robj, NULL, R, + call, extendr, extendr_module, list, pairlist, symbol::class_symbol, Attributes, Conversions, + Length, List, Operators, Rinternals, Robj, NULL, R, }; use flume::{bounded, Sender}; use ipc_channel::ipc; @@ -58,9 +58,6 @@ impl RPolarsRThreadHandle { } } -use extendr_api::Error; -use extendr_api::ExternalPtr; -use extendr_api::Result; #[extendr] impl RPolarsRThreadHandle> { fn join(&mut self) -> RResult { diff --git a/src/rust/src/rdataframe/mod.rs b/src/rust/src/rdataframe/mod.rs index 8425fad1b..21b37addf 100644 --- a/src/rust/src/rdataframe/mod.rs +++ b/src/rust/src/rdataframe/mod.rs @@ -85,7 +85,6 @@ impl From for RPolarsDataFrame { } } -use extendr_api::Result; #[extendr] impl RPolarsDataFrame { pub fn shape(&self) -> Robj { @@ -143,7 +142,11 @@ impl RPolarsDataFrame { } //internal use - pub fn set_column_from_robj(&mut self, robj: Robj, name: &str) -> std::result::Result<(), String> { + pub fn set_column_from_robj( + &mut self, + robj: Robj, + name: &str, + ) -> std::result::Result<(), String> { robjname2series(robj, name) .and_then(|s| self.0.with_column(s).map(|_| ())) .map_err(|err| format!("in set_column_from_robj: {:?}", err)) @@ -607,7 +610,10 @@ impl RPolarsDataFrame { } impl RPolarsDataFrame { - pub fn to_list_result(&self, int64_conversion: &str) -> std::result::Result { + pub fn to_list_result( + &self, + int64_conversion: &str, + ) -> std::result::Result { //convert DataFrame to Result of to R vectors, error if DataType is not supported let robj_vec_res: std::result::Result, _> = self .0 diff --git a/src/rust/src/rpolarserr.rs b/src/rust/src/rpolarserr.rs index 83a45f996..c6e970959 100644 --- a/src/rust/src/rpolarserr.rs +++ b/src/rust/src/rpolarserr.rs @@ -1,8 +1,8 @@ use std::collections::VecDeque; use extendr_api::{ - call, eval_string, eval_string_with_params, extendr, extendr_module, symbol::class_symbol, - Attributes, Nullable, Operators, Pairlist, Robj, Types, R, + call, extendr, extendr_module, symbol::class_symbol, Attributes, Nullable, Operators, Pairlist, + Robj, Types, R, }; #[derive(Clone, Debug, thiserror::Error, serde::Deserialize, serde::Serialize)] @@ -118,9 +118,6 @@ impl Default for RPolarsErr { } } -use extendr_api::Result; -use extendr_api::Error; -use extendr_api::ExternalPtr; #[extendr] impl RPolarsErr { fn default() -> Self { diff --git a/src/rust/src/series.rs b/src/rust/src/series.rs index bc9bee3e4..693e6cf9e 100644 --- a/src/rust/src/series.rs +++ b/src/rust/src/series.rs @@ -86,7 +86,6 @@ impl From<&RPolarsExpr> for pl::PolarsResult { } } -use extendr_api::Result; #[extendr] impl RPolarsSeries { //utility methods diff --git a/src/rust/src/utils/mod.rs b/src/rust/src/utils/mod.rs index 9dfa29ef3..929b8dc08 100644 --- a/src/rust/src/utils/mod.rs +++ b/src/rust/src/utils/mod.rs @@ -10,7 +10,6 @@ use crate::rpolarserr::{polars_to_rpolars_err, rdbg, rerr, RPolarsErr, RResult, use crate::series::RPolarsSeries; use crate::rdataframe::{RPolarsDataFrame, RPolarsLazyFrame}; -use extendr_api::eval_string_with_params; use extendr_api::prelude::{list, Result as EResult, Strings}; use extendr_api::Attributes; use extendr_api::CanBeNA;