Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
CGMossa committed Feb 9, 2024
1 parent 2ec8e07 commit 5163b75
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions extendr-api/src/wrapper/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 1 addition & 3 deletions extendr-macros/src/wrappers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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__";
Expand Down
4 changes: 2 additions & 2 deletions tests/extendrtests/src/rust/src/submodule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -70,7 +70,7 @@ impl MySubmoduleClass {
self
}
}

// Macro to generate exports
extendr_module! {
mod submodule;
Expand Down

0 comments on commit 5163b75

Please sign in to comment.