Skip to content

Commit

Permalink
fix: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
kukkok3 committed Oct 4, 2023
1 parent 10ea6d4 commit a667ac7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ impl ValidVotePlanGenerator {
.voting_tally_end,
chain_voteplan_payload: payload_type.to_string(),
chain_vote_encryption_key: single_vote_plan
.vote_encryption_key()
.unwrap_or_else(|| "".to_string()),
.vote_encryption_key().unwrap_or_default(),
fund_id: self.parameters.current_fund.info.fund_id,
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,24 @@ impl ExternalValidVotingTemplateGenerator {
}

pub fn parse_proposals(proposals: PathBuf) -> Result<LinkedList<ProposalTemplate>, TemplateLoad> {
serde_json::from_str(&std::fs::read_to_string(&proposals)?)
serde_json::from_str(&std::fs::read_to_string(proposals)?)
.map_err(|err| TemplateLoad::Proposal(err.to_string()))
}

pub fn parse_challenges(
challenges: PathBuf,
) -> Result<LinkedList<ChallengeTemplate>, TemplateLoad> {
serde_json::from_str(&std::fs::read_to_string(&challenges)?)
serde_json::from_str(&std::fs::read_to_string(challenges)?)
.map_err(|err| TemplateLoad::Challenge(err.to_string()))
}

pub fn parse_funds(funds: PathBuf) -> Result<LinkedList<FundTemplate>, TemplateLoad> {
serde_json::from_str(&std::fs::read_to_string(&funds)?)
serde_json::from_str(&std::fs::read_to_string(funds)?)
.map_err(|err| TemplateLoad::Fund(err.to_string()))
}

pub fn parse_reviews(reviews: PathBuf) -> Result<LinkedList<ReviewTemplate>, TemplateLoad> {
serde_json::from_str(&std::fs::read_to_string(&reviews)?)
serde_json::from_str(&std::fs::read_to_string(reviews)?)
.map_err(|err| TemplateLoad::Review(err.to_string()))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ impl Logger {
}

pub fn any_error(&self) -> bool {
self.log_lines().iter().any(|x| x.contains(&"[ERROR]"))
self.log_lines().iter().any(|x| x.contains("[ERROR]"))
}
}

0 comments on commit a667ac7

Please sign in to comment.