Skip to content

Commit 1a6da82

Browse files
committed
clippy
1 parent c6f0c97 commit 1a6da82

File tree

3 files changed

+12
-23
lines changed

3 files changed

+12
-23
lines changed

catalyst-toolbox/src/bin/cli/rewards/voters.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,6 @@ pub struct VotersRewards {
3737
/// Number of global votes required to be able to receive voter rewards
3838
#[structopt(long, default_value)]
3939
vote_threshold: u64,
40-
41-
/// Path to a json-encoded map from challenge id to an optional required threshold
42-
/// per-challenge in order to receive rewards.
43-
#[structopt(long)]
44-
per_challenge_threshold: Option<PathBuf>,
45-
46-
/// Path to the list of proposals active in this election.
47-
/// Can be obtained from /api/v0/proposals.
48-
#[structopt(long)]
49-
proposals: PathBuf,
5040
}
5141

5242
fn write_rewards_results(
@@ -74,8 +64,6 @@ impl VotersRewards {
7464
snapshot_info_path,
7565
votes_count_path,
7666
vote_threshold,
77-
per_challenge_threshold,
78-
proposals,
7967
} = self;
8068

8169
voter_rewards(

catalyst-toolbox/src/ideascale/mod.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,20 @@ pub fn build_challenges(
123123
.challenges
124124
.iter()
125125
.map(|(i, c)| {
126+
let is_community = funnels
127+
.get(&c.funnel_id)
128+
.unwrap_or_else(|| panic!("A funnel with id {} wasn't found", c.funnel_id))
129+
.is_community();
130+
131+
let challenge_type = match is_community {
132+
true => "community-choice".to_string(),
133+
false => "simple".to_string(),
134+
};
135+
126136
(
127137
c.id,
128138
models::se::Challenge {
129-
challenge_type: funnels
130-
.get(&c.funnel_id)
131-
.unwrap_or_else(|| panic!("A funnel with id {} wasn't found", c.funnel_id))
132-
.is_community()
133-
.then(|| "community-choice")
134-
.unwrap_or("simple")
135-
.to_string(),
139+
challenge_type,
136140
challenge_url: c.challenge_url.clone(),
137141
description: c.description.to_string(),
138142
fund_id: fund.to_string(),

snapshot-lib/src/influence_cap.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ pub fn cap_voting_influence(
4949
mut voters: Vec<SnapshotInfo>,
5050
threshold: Fraction,
5151
) -> Result<Vec<SnapshotInfo>, Error> {
52-
voters = voters
53-
.into_iter()
54-
.filter(|v| v.hir.voting_power > 0.into())
55-
.collect();
52+
voters.retain(|v| v.hir.voting_power > 0.into());
5653

5754
if voters.is_empty() {
5855
return Ok(voters);

0 commit comments

Comments
 (0)