Skip to content

Commit

Permalink
Rust lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyalIcing committed Jan 17, 2024
1 parent b6fe620 commit 52b9fe7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions native/wasmex/src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn link_import(
let import_tuple = tuple::get_tuple(definition)?;

let import_type = import_tuple
.get(0)
.first()
.ok_or(Error::Atom("missing_import_type"))?;
let import_type =
Atom::from_term(*import_type).map_err(|_| Error::Atom("import type must be an atom"))?;
Expand Down Expand Up @@ -126,7 +126,7 @@ fn link_imported_function(
let caller_token = set_caller(caller);

let mut msg_env = OwnedEnv::new();
msg_env.send_and_clear(&pid.clone(), |env| {
let result = msg_env.send_and_clear(&pid.clone(), |env| {
let mut callback_params: Vec<Term> = Vec::with_capacity(params.len());
for value in params {
callback_params.push(match value {
Expand Down Expand Up @@ -183,6 +183,8 @@ fn link_imported_function(
.encode(env)
});

result.expect("expect no send error");

// Wait for the thread to start up - `receive_callback_result` is responsible for that.
let mut result = callback_token.token.return_values.lock().unwrap();
while result.is_none() {
Expand Down

0 comments on commit 52b9fe7

Please sign in to comment.