Skip to content

Commit

Permalink
Fix clippy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bkolobara committed Jul 29, 2021
1 parent 5535dad commit 389fcff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/api/networking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ fn resolve(
let name = std::str::from_utf8(buffer.as_slice()).or_trap("lunatic::network::resolve")?;
let (iter_or_error_id, result) = match tokio::net::lookup_host(name).await {
Ok(iter) => {
// This is a bug in clippy, this collect is not needless
#[allow(clippy::needless_collect)]
let vec: Vec<SocketAddr> = iter.collect();
let id = caller
.data_mut()
Expand Down
2 changes: 1 addition & 1 deletion src/api/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ async fn spawn_from_module(
Some(process)
}
};
let (mod_or_error_id, result) = match module.spawn(&function, params, link).await {
let (mod_or_error_id, result) = match module.spawn(function, params, link).await {
Ok((_, process)) => (caller.data_mut().resources.processes.add(process), 0),
Err(error) => (caller.data_mut().errors.add(error), 1),
};
Expand Down
6 changes: 3 additions & 3 deletions src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl Module {
.expect("receiver must exist at this point");
}

let mut store = Store::new(&self.environment().engine(), state);
let mut store = Store::new(self.environment().engine(), state);
store.limiter(|state| state);

// Trap if out of fuel
Expand All @@ -92,10 +92,10 @@ impl Module {
let instance = self
.environment()
.linker()
.instantiate_async(&mut store, &self.wasmtime_module())
.instantiate_async(&mut store, self.wasmtime_module())
.await?;
let entry = instance
.get_func(&mut store, &function)
.get_func(&mut store, function)
.map_or(Err(anyhow!("Function '{}' not found", function)), |func| {
Ok(func)
})?;
Expand Down

0 comments on commit 389fcff

Please sign in to comment.