From e9c2905795810e278d683aef62b64c88755a6f64 Mon Sep 17 00:00:00 2001 From: Patrick Ventuzelo Date: Fri, 13 Dec 2019 10:55:21 +0100 Subject: [PATCH] fix introduced clippy warning --- crates/lightbeam/src/backend.rs | 8 ++------ crates/lightbeam/src/function_body.rs | 12 +++++++----- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/crates/lightbeam/src/backend.rs b/crates/lightbeam/src/backend.rs index 5a52466041..c03442e441 100644 --- a/crates/lightbeam/src/backend.rs +++ b/crates/lightbeam/src/backend.rs @@ -346,11 +346,7 @@ impl Registers { let c = &mut scratch_counts.1[gpr as usize]; *c = match c.checked_sub(1) { Some(e) => e, - None => { - return Err(Error::Microwasm( - format!("Double-freed register: {}", gpr).to_string(), - )) - } + None => return Err(Error::Microwasm(format!("Double-freed register: {}", gpr))), }; if *c == 0 { scratch_counts.0.release(gpr); @@ -2094,7 +2090,7 @@ macro_rules! store { } if !(offset <= i32::max_value() as u32) { - return Err(Error::Microwasm(format!("store: offset value too big {}", offset).to_string())) + return Err(Error::Microwasm(format!("store: offset value too big {}", offset))) } let mut src = self.pop()?; diff --git a/crates/lightbeam/src/function_body.rs b/crates/lightbeam/src/function_body.rs index 2c53905dcb..eca60528a1 100644 --- a/crates/lightbeam/src/function_body.rs +++ b/crates/lightbeam/src/function_body.rs @@ -396,13 +396,14 @@ where (&mut else_block.calling_convention, &else_.to_drop), ) { ((Some(Left(ref cc)), _), ref mut other @ (None, _)) - | (ref mut other @ (None, _), (Some(Left(ref cc)), _)) => Ok({ + | (ref mut other @ (None, _), (Some(Left(ref cc)), _)) => { let mut cc = ctx.serialize_block_args(cc, max_params)?; if let Some(to_drop) = other.1 { drop_elements(&mut cc.arguments, to_drop.clone()); } *other.0 = Some(Left(cc)); - }), + Ok(()) + }, ( (ref mut then_cc @ None, then_to_drop), (ref mut else_cc @ None, else_to_drop), @@ -464,9 +465,10 @@ where ctx.br(else_); } other => { - return Err(Error::Microwasm( - format!("br_if unimplemented case: {:#?}", other).to_string(), - )) + return Err(Error::Microwasm(format!( + "br_if unimplemented case: {:#?}", + other + ))) } }; }