@@ -3,7 +3,7 @@ use std::{fmt, rc::Rc};
3
3
use rant:: {
4
4
compiler:: { CompilerError , CompilerMessage } ,
5
5
runtime:: { RuntimeError , VM } ,
6
- AsRantFunction , NoModuleResolver , Rant , RantOptions , RantValue ,
6
+ IntoRantFunction , NoModuleResolver , Rant , RantOptions , RantValue ,
7
7
} ;
8
8
use wasm_bindgen:: prelude:: * ;
9
9
@@ -33,11 +33,14 @@ fn _rant(input: &str, seed: u32) -> Result<RantValue, RantError> {
33
33
34
34
fn register_markdown_functions ( rant : & mut Rant ) {
35
35
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 ( ) ) ) ) ;
41
44
}
42
45
43
46
fn italic ( vm : & mut VM , val : RantValue ) -> Result < ( ) , RuntimeError > {
0 commit comments