Skip to content

Commit 52b9fe7

Browse files
committed
Rust lint errors
1 parent b6fe620 commit 52b9fe7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

native/wasmex/src/environment.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fn link_import(
4747
let import_tuple = tuple::get_tuple(definition)?;
4848

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

128128
let mut msg_env = OwnedEnv::new();
129-
msg_env.send_and_clear(&pid.clone(), |env| {
129+
let result = msg_env.send_and_clear(&pid.clone(), |env| {
130130
let mut callback_params: Vec<Term> = Vec::with_capacity(params.len());
131131
for value in params {
132132
callback_params.push(match value {
@@ -183,6 +183,8 @@ fn link_imported_function(
183183
.encode(env)
184184
});
185185

186+
result.expect("expect no send error");
187+
186188
// Wait for the thread to start up - `receive_callback_result` is responsible for that.
187189
let mut result = callback_token.token.return_values.lock().unwrap();
188190
while result.is_none() {

0 commit comments

Comments
 (0)