aboutsummaryrefslogtreecommitdiffstats
path: root/tests/xxx_mdx_plugin_recma_jsx_rewrite.rs
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/xxx_mdx_plugin_recma_jsx_rewrite.rs
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/xxx_mdx_plugin_recma_jsx_rewrite.rs')
-rw-r--r--tests/xxx_mdx_plugin_recma_jsx_rewrite.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/xxx_mdx_plugin_recma_jsx_rewrite.rs b/tests/xxx_mdx_plugin_recma_jsx_rewrite.rs
index 497155f..b1d2ca8 100644
--- a/tests/xxx_mdx_plugin_recma_jsx_rewrite.rs
+++ b/tests/xxx_mdx_plugin_recma_jsx_rewrite.rs
@@ -25,11 +25,10 @@ fn from_markdown(value: &str, options: &RewriteOptions) -> Result<String, String
},
)?;
let hast = mdast_util_to_hast(&mdast);
- let program = hast_util_to_swc(&hast, Some("example.mdx".into()), Some(&location))?;
- let program = mdx_plugin_recma_document(program, &DocumentOptions::default(), Some(&location))?;
- let program = mdx_plugin_recma_jsx_rewrite(program, options, Some(&location));
- let value = serialize(&program.module);
- Ok(value)
+ let mut program = hast_util_to_swc(&hast, Some("example.mdx".into()), Some(&location))?;
+ mdx_plugin_recma_document(&mut program, &DocumentOptions::default(), Some(&location))?;
+ mdx_plugin_recma_jsx_rewrite(&mut program, options, Some(&location));
+ Ok(serialize(&program.module))
}
#[test]