mirror of
https://github.com/eternal-flame-AD/unitdc-rs.git
synced 2024-11-24 03:26: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]
|
||||
pub fn unitdc_init(js_output: Function) {
|
||||
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) => {
|
||||
js_output
|
||||
.call2(
|
||||
|
@ -52,12 +52,13 @@ pub fn unitdc_init(js_output: Function) {
|
|||
.call2(&JsValue::NULL, &JsValue::from("message"), &JsValue::from(e))
|
||||
.unwrap();
|
||||
}
|
||||
})));
|
||||
INTERPRETER
|
||||
.as_mut()
|
||||
.unwrap()
|
||||
}));
|
||||
|
||||
interp
|
||||
.run_str(include_str!("../../../unitdc.rc"))
|
||||
.unwrap();
|
||||
.expect("could not run initialization script");
|
||||
|
||||
INTERPRETER = Some(interp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue