Skip to content

Commit eda86db

Browse files
committed
build: Update rant to new version v4.0.0-alpha.31
1 parent bb6d2d0 commit eda86db

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ crate-type = ["cdylib"]
1010
[dependencies]
1111
wasm-bindgen = "0.2"
1212
getrandom = { version="*", features = ["js"] }
13-
rant = "4.0.0-alpha.29"
13+
rant = "4.0.0-alpha.31"

src/lib.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::{fmt, rc::Rc};
33
use rant::{
44
compiler::{CompilerError, CompilerMessage},
55
runtime::{RuntimeError, VM},
6-
AsRantFunction, NoModuleResolver, Rant, RantOptions, RantValue,
6+
IntoRantFunction, NoModuleResolver, Rant, RantOptions, RantValue,
77
};
88
use wasm_bindgen::prelude::*;
99

@@ -33,11 +33,14 @@ fn _rant(input: &str, seed: u32) -> Result<RantValue, RantError> {
3333

3434
fn register_markdown_functions(rant: &mut Rant) {
3535
use RantValue::Function;
36-
rant.set_global("italic", Function(Rc::new(italic.as_rant_func())));
37-
rant.set_global("bold", Function(Rc::new(bold.as_rant_func())));
38-
rant.set_global("bold-italic", Function(Rc::new(bold_italic.as_rant_func())));
39-
rant.set_global("highlight", Function(Rc::new(highlight.as_rant_func())));
40-
rant.set_global("link", Function(Rc::new(link.as_rant_func())));
36+
rant.set_global("italic", Function(Rc::new(italic.into_rant_func())));
37+
rant.set_global("bold", Function(Rc::new(bold.into_rant_func())));
38+
rant.set_global(
39+
"bold-italic",
40+
Function(Rc::new(bold_italic.into_rant_func())),
41+
);
42+
rant.set_global("highlight", Function(Rc::new(highlight.into_rant_func())));
43+
rant.set_global("link", Function(Rc::new(link.into_rant_func())));
4144
}
4245

4346
fn italic(vm: &mut VM, val: RantValue) -> Result<(), RuntimeError> {

0 commit comments

Comments
 (0)