mirror of
https://github.com/eternal-flame-AD/unitdc-rs.git
synced 2024-11-27 21:06:43 -06:00
Fix a lint warning on nightly
Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
This commit is contained in:
parent
056468ca52
commit
13dad10e10
1 changed files with 7 additions and 6 deletions
|
@ -28,7 +28,7 @@ pub fn unitdc_input(input: String) -> Result<(), JsValue> {
|
||||||
#[wasm_bindgen]
|
#[wasm_bindgen]
|
||||||
pub fn unitdc_init(js_output: Function) {
|
pub fn unitdc_init(js_output: Function) {
|
||||||
unsafe {
|
unsafe {
|
||||||
INTERPRETER = Some(Interpreter::new(Box::new(move |output| match output {
|
let mut interp = Interpreter::new(Box::new(move |output| match output {
|
||||||
Output::Quantity(q) => {
|
Output::Quantity(q) => {
|
||||||
js_output
|
js_output
|
||||||
.call2(
|
.call2(
|
||||||
|
@ -52,12 +52,13 @@ pub fn unitdc_init(js_output: Function) {
|
||||||
.call2(&JsValue::NULL, &JsValue::from("message"), &JsValue::from(e))
|
.call2(&JsValue::NULL, &JsValue::from("message"), &JsValue::from(e))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
})));
|
}));
|
||||||
INTERPRETER
|
|
||||||
.as_mut()
|
interp
|
||||||
.unwrap()
|
|
||||||
.run_str(include_str!("../../../unitdc.rc"))
|
.run_str(include_str!("../../../unitdc.rc"))
|
||||||
.unwrap();
|
.expect("could not run initialization script");
|
||||||
|
|
||||||
|
INTERPRETER = Some(interp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue