Skip to content

Commit

Permalink
fix lint issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joinhack committed Aug 23, 2024
1 parent 49185aa commit a3729fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
15 changes: 9 additions & 6 deletions crates/cli/tests/dylib_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ fn test_dylib_with_exported_func() -> Result<()> {
Ok(())
}

fn run_js_src<T: WasiFile + Clone + 'static>(js_src: &str, stderr: &T, is_stderr: bool) -> Result<()> {
fn run_js_src<T: WasiFile + Clone + 'static>(
js_src: &str,
stderr: &T,
is_stderr: bool,
) -> Result<()> {
let (instance, mut store) = create_wasm_env(stderr, is_stderr)?;

let eval_bytecode_func =
Expand All @@ -56,7 +60,6 @@ fn run_js_src<T: WasiFile + Clone + 'static>(js_src: &str, stderr: &T, is_stderr
Ok(())
}


fn run_invoke<T: WasiFile + Clone + 'static>(
js_src: &str,
fn_to_invoke: &str,
Expand All @@ -83,12 +86,12 @@ fn create_wasm_env<T: WasiFile + Clone + 'static>(
wasmtime_wasi::add_to_linker(&mut linker, |s| s)?;
let wasi = if is_stderr {
WasiCtxBuilder::new()
.stderr(Box::new(stderr.clone()))
.build()
.stderr(Box::new(stderr.clone()))
.build()
} else {
WasiCtxBuilder::new()
.stdout(Box::new(stderr.clone()))
.build()
.stdout(Box::new(stderr.clone()))
.build()
};
let module = common::create_quickjs_provider_module(&engine)?;

Expand Down
3 changes: 2 additions & 1 deletion crates/cli/tests/dynamic_linking_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ pub fn test_dynamic_linking_with_func() -> Result<()> {
export foo-bar: func()
}
";
let log_output = invoke_fn_on_generated_module(js_src, "foo-bar", Some((wit, "foo-test")), false)?;
let log_output =
invoke_fn_on_generated_module(js_src, "foo-bar", Some((wit, "foo-test")), false)?;
assert_eq!("Toplevel\nIn foo\n", &log_output);
Ok(())
}
Expand Down

0 comments on commit a3729fb

Please sign in to comment.