diff --git a/extendr-api/src/wrapper/macros.rs b/extendr-api/src/wrapper/macros.rs index 54871c75c9..d9440300c4 100644 --- a/extendr-api/src/wrapper/macros.rs +++ b/extendr-api/src/wrapper/macros.rs @@ -14,13 +14,13 @@ macro_rules! gen_vector_wrapper_impl { $type::new(0) } } - + impl $type { #[doc = "Returns a slice of the underlying data"] pub fn as_slice(&self) -> &[$scalar_type] { self.robj.as_typed_slice().unwrap() } - + #[doc = "Returns a mutable slice of the underlying data"] pub fn as_slice_mut(&mut self) -> &mut [$scalar_type] { self.robj.as_typed_slice_mut().unwrap() diff --git a/extendr-macros/src/wrappers.rs b/extendr-macros/src/wrappers.rs index 3154ba71a1..9992e857c9 100644 --- a/extendr-macros/src/wrappers.rs +++ b/extendr-macros/src/wrappers.rs @@ -5,9 +5,7 @@ use proc_macro2::Ident; use quote::{format_ident, quote}; -use syn::{ - parse_quote, punctuated::Punctuated, Expr, ExprLit, FnArg, ItemFn, Token, Type, -}; +use syn::{parse_quote, punctuated::Punctuated, Expr, ExprLit, FnArg, ItemFn, Token, Type}; pub const META_PREFIX: &str = "meta__"; pub const WRAP_PREFIX: &str = "wrap__"; diff --git a/tests/extendrtests/src/rust/src/submodule.rs b/tests/extendrtests/src/rust/src/submodule.rs index c804019349..4dd488ba7c 100644 --- a/tests/extendrtests/src/rust/src/submodule.rs +++ b/tests/extendrtests/src/rust/src/submodule.rs @@ -37,7 +37,7 @@ impl MySubmoduleClass { fn a(&self) -> i32 { self.a } - + // NOTE: Cannot move ownership, as that concept is incompatible with bridging // data from R to Rust // fn myself(self) -> Self { @@ -70,7 +70,7 @@ impl MySubmoduleClass { self } } - + // Macro to generate exports extendr_module! { mod submodule;