Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
hard-nett committed Aug 15, 2024
1 parent 6dffdb6 commit 1329e18
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion contracts/gauges/gauge/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ mod execute {
})
}

#[allow(clippy::too_many_arguments)]
pub fn update_gauge(
deps: DepsMut,
sender: Addr,
Expand Down Expand Up @@ -759,7 +760,7 @@ mod execute {
}

pub fn execute(deps: DepsMut, env: Env, gauge_id: u64) -> Result<Response, ContractError> {
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 {
Expand Down
12 changes: 6 additions & 6 deletions contracts/gauges/gauge/src/multitest/gauge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -769,7 +769,7 @@ fn update_gauge() {

let err = suite
.update_gauge(
&dao.as_str(),
dao.as_str(),
gauge_contract.clone(),
0,
50,
Expand All @@ -783,7 +783,7 @@ fn update_gauge() {

let err = suite
.update_gauge(
&dao.as_str(),
dao.as_str(),
gauge_contract.clone(),
0,
new_epoch,
Expand All @@ -800,7 +800,7 @@ fn update_gauge() {

let err = suite
.update_gauge(
&dao.as_str(),
dao.as_str(),
gauge_contract.clone(),
0,
new_epoch,
Expand All @@ -817,7 +817,7 @@ fn update_gauge() {

let err = suite
.update_gauge(
&dao.as_str(),
dao.as_str(),
gauge_contract,
1,
None,
Expand Down
2 changes: 1 addition & 1 deletion contracts/gauges/gauge/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl Gauge {
Ok(self.count.map_or(Some(0), |o| Some(o + 1)))
}
pub fn gauge_epoch(&self) -> StdResult<u64> {
Ok(self.count.map_or(Some(0), |o| Some(o)).unwrap_or_default())
Ok(self.count.map_or(Some(0), Some).unwrap_or_default())
}
}

Expand Down

0 comments on commit 1329e18

Please sign in to comment.