diff --git a/module.wasm b/module.wasm index edf544b..d459b08 100644 Binary files a/module.wasm and b/module.wasm differ diff --git a/src/lib.rs b/src/lib.rs index 3b25040..11a1e28 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -57,9 +57,7 @@ pub fn invoke(_ctx: Context, inputs: Inputs) -> Result { for d in &input.duties { if d.frequency < 0.0 || d.tariff_eur_per_hour < 0.0 || d.time_hours_per_case < 0.0 { - return Err(ModuleError::invalid_input( - "negative P/F/T/h not allowed", - )); + return Err(ModuleError::invalid_input("negative P/F/T/h not allowed")); } let value = d.population as f64 * d.frequency as f64 @@ -84,7 +82,11 @@ pub fn invoke(_ctx: Context, inputs: Inputs) -> Result { total += value; } - let r = Report { items, total_eur_per_year: total, tier_lowest }; + let r = Report { + items, + total_eur_per_year: total, + tier_lowest, + }; Outputs::new().with_json("report", &r) } @@ -97,11 +99,16 @@ fn lower_tier(a: &str, b: &str) -> String { "T3" => 3, _ => 4, }; - if rank(b) > rank(a) { b.to_string() } else { a.to_string() } + if rank(b) > rank(a) { + b.to_string() + } else { + a.to_string() + } } #[cfg(test)] mod tests { + #![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)] use super::*; #[test] @@ -155,6 +162,10 @@ mod tests { tier: t, }); } - Ok(Report { items, total_eur_per_year: total, tier_lowest: tier }) + Ok(Report { + items, + total_eur_per_year: total, + tier_lowest: tier, + }) } }