Skip to content

Commit 00ce465

Browse files
Fix rust_source() examples (#114)
* Fixing examples of 'rust_source' usage * Updating docs * Running {styler}
1 parent 9088db8 commit 00ce465

File tree

3 files changed

+10
-28
lines changed

3 files changed

+10
-28
lines changed

R/source.R

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@
5555
#' fn test( a: &str, b: i64) {
5656
#' rprintln!("Data sent to Rust: {}, {}", a, b);
5757
#' }
58-
#'
59-
#' extendr_module! {
60-
#' mod rextendr;
61-
#' fn hello;
62-
#' fn test;
63-
#' }
6458
#' )"
6559
#'
6660
#' rust_source(code = code)
@@ -82,13 +76,11 @@
8276
#' html::push_html(&mut output, parser);
8377
#' output
8478
#' }
85-
#'
86-
#' extendr_module! {
87-
#' mod rextendr;
88-
#' fn md_to_html;
89-
#' }
9079
#' )"
91-
#' rust_source(code = code, dependencies = 'pulldown-cmark = "0.8"')
80+
#' rust_source(
81+
#' code = code,
82+
#' dependencies = list(`pulldown-cmark` = "0.8")
83+
#' )
9284
#'
9385
#' md_text <- "# The story of the fox
9486
#' The quick brown fox **jumps over** the lazy dog.
@@ -128,13 +120,11 @@ rust_source <- function(file, code = NULL,
128120
# R console displays to the user informaion about compilation steps and
129121
# potenatial compilation errors.
130122
out <- ""
131-
132123
} else {
133124

134125
# `NULL` or `FALSE` intercepts standard output from `cargo`.
135126
# No compilation information is displayed to the user.
136127
out <- NULL
137-
138128
}
139129

140130
# copy rust code into src/lib.rs and determine library name

man/rust_eval.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/rust_source.Rd

Lines changed: 4 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)