aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_utils
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-11 16:33:15 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-11 16:33:15 +0200
commit04e20a76e8022e3c1157314f598b765e9e073dcc (patch)
tree2a60bd77846f53db60c9351eb65de308da2f30fb /tests/test_utils
parente484d1ecc5e405259767c0fd84072226fee40b71 (diff)
downloadmarkdown-rs-04e20a76e8022e3c1157314f598b765e9e073dcc.tar.gz
markdown-rs-04e20a76e8022e3c1157314f598b765e9e073dcc.tar.bz2
markdown-rs-04e20a76e8022e3c1157314f598b765e9e073dcc.zip
Refactor some internals to accept mutable references
Diffstat (limited to 'tests/test_utils')
-rw-r--r--tests/test_utils/mdx_plugin_recma_document.rs6
-rw-r--r--tests/test_utils/mdx_plugin_recma_jsx_rewrite.rs6
2 files changed, 5 insertions, 7 deletions
diff --git a/tests/test_utils/mdx_plugin_recma_document.rs b/tests/test_utils/mdx_plugin_recma_document.rs
index a62862c..5c0d423 100644
--- a/tests/test_utils/mdx_plugin_recma_document.rs
+++ b/tests/test_utils/mdx_plugin_recma_document.rs
@@ -72,10 +72,10 @@ impl Default for Options {
#[allow(dead_code)]
pub fn mdx_plugin_recma_document(
- mut program: Program,
+ program: &mut Program,
options: &Options,
location: Option<&Location>,
-) -> Result<Program, String> {
+) -> Result<(), String> {
// New body children.
let mut replacements = vec![];
@@ -412,7 +412,7 @@ pub fn mdx_plugin_recma_document(
program.module.body = replacements;
- Ok(program)
+ Ok(())
}
/// Create a content component.
diff --git a/tests/test_utils/mdx_plugin_recma_jsx_rewrite.rs b/tests/test_utils/mdx_plugin_recma_jsx_rewrite.rs
index 6a4d451..89e0ebd 100644
--- a/tests/test_utils/mdx_plugin_recma_jsx_rewrite.rs
+++ b/tests/test_utils/mdx_plugin_recma_jsx_rewrite.rs
@@ -31,10 +31,10 @@ pub struct Options {
/// Rewrite JSX in an MDX file so that components can be passed in and provided.
#[allow(dead_code)]
pub fn mdx_plugin_recma_jsx_rewrite(
- mut program: Program,
+ program: &mut Program,
options: &Options,
location: Option<&Location>,
-) -> Program {
+) {
let mut state = State {
scopes: vec![],
location,
@@ -65,8 +65,6 @@ pub fn mdx_plugin_recma_jsx_rewrite(
.body
.push(create_error_helper(state.development, state.path));
}
-
- program
}
/// Collection of different SWC functions.