From 389fcff2a71fedc45c1a3b951d497bbb5736e30e Mon Sep 17 00:00:00 2001 From: Bernard Kolobara Date: Thu, 29 Jul 2021 19:19:34 +0200 Subject: [PATCH] Fix clippy issues --- src/api/networking.rs | 2 ++ src/api/process.rs | 2 +- src/module.rs | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/api/networking.rs b/src/api/networking.rs index 525afe214..401830415 100644 --- a/src/api/networking.rs +++ b/src/api/networking.rs @@ -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 = iter.collect(); let id = caller .data_mut() diff --git a/src/api/process.rs b/src/api/process.rs index 9c39d9753..4aaa44340 100644 --- a/src/api/process.rs +++ b/src/api/process.rs @@ -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), }; diff --git a/src/module.rs b/src/module.rs index d4824ca60..5100a776b 100644 --- a/src/module.rs +++ b/src/module.rs @@ -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 @@ -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) })?;