From 1329e18ef899bf11a4c59a449811aa4ce2fbd038 Mon Sep 17 00:00:00 2001 From: hard-nett Date: Thu, 15 Aug 2024 09:50:54 -0400 Subject: [PATCH] clippy --- contracts/gauges/gauge/src/contract.rs | 3 ++- contracts/gauges/gauge/src/multitest/gauge.rs | 12 ++++++------ contracts/gauges/gauge/src/state.rs | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/contracts/gauges/gauge/src/contract.rs b/contracts/gauges/gauge/src/contract.rs index b86990698..05f9420f2 100644 --- a/contracts/gauges/gauge/src/contract.rs +++ b/contracts/gauges/gauge/src/contract.rs @@ -446,6 +446,7 @@ mod execute { }) } + #[allow(clippy::too_many_arguments)] pub fn update_gauge( deps: DepsMut, sender: Addr, @@ -759,7 +760,7 @@ mod execute { } pub fn execute(deps: DepsMut, env: Env, gauge_id: u64) -> Result { - let mut gauge = GAUGES.load(deps.storage, gauge_id.clone())?; + let mut gauge = GAUGES.load(deps.storage, gauge_id)?; let mut msgs = vec![]; if gauge.is_stopped { diff --git a/contracts/gauges/gauge/src/multitest/gauge.rs b/contracts/gauges/gauge/src/multitest/gauge.rs index 57aabeffa..7c5dfb518 100644 --- a/contracts/gauges/gauge/src/multitest/gauge.rs +++ b/contracts/gauges/gauge/src/multitest/gauge.rs @@ -658,7 +658,7 @@ fn update_gauge() { let new_max_available_percentage = Some(Decimal::percent(5)); suite .update_gauge( - &dao.as_str(), + dao.as_str(), gauge_contract.clone(), 0, new_epoch, @@ -705,7 +705,7 @@ fn update_gauge() { // clean setting of min_percent_selected on second gauge suite .update_gauge( - &dao.as_str(), + dao.as_str(), gauge_contract.clone(), 1, None, @@ -769,7 +769,7 @@ fn update_gauge() { let err = suite .update_gauge( - &dao.as_str(), + dao.as_str(), gauge_contract.clone(), 0, 50, @@ -783,7 +783,7 @@ fn update_gauge() { let err = suite .update_gauge( - &dao.as_str(), + dao.as_str(), gauge_contract.clone(), 0, new_epoch, @@ -800,7 +800,7 @@ fn update_gauge() { let err = suite .update_gauge( - &dao.as_str(), + dao.as_str(), gauge_contract.clone(), 0, new_epoch, @@ -817,7 +817,7 @@ fn update_gauge() { let err = suite .update_gauge( - &dao.as_str(), + dao.as_str(), gauge_contract, 1, None, diff --git a/contracts/gauges/gauge/src/state.rs b/contracts/gauges/gauge/src/state.rs index ed4e12783..4ea45b8f7 100644 --- a/contracts/gauges/gauge/src/state.rs +++ b/contracts/gauges/gauge/src/state.rs @@ -99,7 +99,7 @@ impl Gauge { Ok(self.count.map_or(Some(0), |o| Some(o + 1))) } pub fn gauge_epoch(&self) -> StdResult { - Ok(self.count.map_or(Some(0), |o| Some(o)).unwrap_or_default()) + Ok(self.count.map_or(Some(0), Some).unwrap_or_default()) } }