Skip to content

Commit

Permalink
More lint fixes and a compilation fix for c_api
Browse files Browse the repository at this point in the history
  • Loading branch information
john-sharratt committed Jul 26, 2023
1 parent 218e7d8 commit 405a4e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
7 changes: 3 additions & 4 deletions lib/c-api/src/wasm_c_api/wasi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ unsafe fn wasi_env_with_filesystem_inner(
let module = &module.as_ref()?.inner;
let imports = imports?;

let (wasi_env, import_object, runtime) = prepare_webc_env(
let (wasi_env, import_object) = prepare_webc_env(
config,
&mut store.store_mut(),
module,
Expand All @@ -247,7 +247,6 @@ unsafe fn wasi_env_with_filesystem_inner(
Some(Box::new(wasi_env_t {
inner: wasi_env,
store: store.clone(),
_runtime: runtime,
}))
}

Expand All @@ -259,7 +258,7 @@ fn prepare_webc_env(
bytes: &'static u8,
len: usize,
package_name: &str,
) -> Option<(WasiFunctionEnv, Imports, tokio::runtime::Runtime)> {
) -> Option<(WasiFunctionEnv, Imports)> {
use virtual_fs::static_fs::StaticFileSystem;
use webc::v1::{FsEntryType, WebC};

Expand Down Expand Up @@ -316,7 +315,7 @@ fn prepare_webc_env(
let env = builder.finalize(store).ok()?;

let import_object = env.import_object(store, module).ok()?;
Some((env, import_object, runtime))
Some((env, import_object))
}

#[allow(non_camel_case_types)]
Expand Down
10 changes: 4 additions & 6 deletions lib/wasix/src/runtime/task_manager/tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ impl From<Runtime> for RuntimeOrHandle {
impl Drop for RuntimeOrHandle {
fn drop(&mut self) {
if let Self::Runtime(_, runtime) = self {
runtime
.lock()
.unwrap()
.take()
.map(|h| h.shutdown_timeout(Duration::from_secs(0)));
if let Some(h) = runtime.lock().unwrap().take() {
h.shutdown_timeout(Duration::from_secs(0))
}
}
}
}
Expand Down Expand Up @@ -80,7 +78,7 @@ impl TokioTaskManager {

impl Default for TokioTaskManager {
fn default() -> Self {
Self::new(Handle::current().clone())
Self::new(Handle::current())
}
}

Expand Down

0 comments on commit 405a4e6

Please sign in to comment.