Skip to content

Commit

Permalink
extendrtests: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
CGMossa committed Feb 4, 2024
1 parent 04f5b68 commit 14ed43c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/extendrtests/src/rust/src/optional_either.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use extendr_api::prelude::*;

#[extendr(use_try_from = true)]
fn type_aware_sum(input : Either<Integers, Doubles>) -> Either<Rint, Rfloat> {
fn type_aware_sum(input: Either<Integers, Doubles>) -> Either<Rint, Rfloat> {
match input {
Left(left) => Left(left.iter().sum()),
Right(right) => Right(right.iter().sum()),
Expand Down
9 changes: 4 additions & 5 deletions tests/extendrtests/src/rust/src/submodule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,24 @@ impl MySubmoduleClass {
fn new() -> Self {
Self { a: 0 }
}

/// Method for setting stuff.
/// @param x a number
fn set_a(& mut self, x: i32) {
fn set_a(&mut self, x: i32) {
self.a = x;
}

/// Method for getting stuff.
fn a(&self) -> i32 {
self.a
}

/// Method for getting one's self.
fn me(&self) -> &Self {
self
}
}


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

0 comments on commit 14ed43c

Please sign in to comment.