From a667ac77afe9cc4343c45c337e81aaedc5058b3d Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:10:04 +0200 Subject: [PATCH] fix: clippy --- .../src/common/data/generator/voting/generator.rs | 3 +-- .../src/common/data/generator/voting/template/external.rs | 8 ++++---- .../vit-servicing-station-tests-f10/src/common/logger.rs | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/data/generator/voting/generator.rs b/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/data/generator/voting/generator.rs index 51c8ab2ba2..cbf78c4297 100644 --- a/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/data/generator/voting/generator.rs +++ b/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/data/generator/voting/generator.rs @@ -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, } }) diff --git a/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/data/generator/voting/template/external.rs b/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/data/generator/voting/template/external.rs index d088871c88..ff7d20db1b 100644 --- a/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/data/generator/voting/template/external.rs +++ b/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/data/generator/voting/template/external.rs @@ -63,24 +63,24 @@ impl ExternalValidVotingTemplateGenerator { } pub fn parse_proposals(proposals: PathBuf) -> Result, 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, 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, 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, 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())) } diff --git a/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/logger.rs b/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/logger.rs index 47f42f8732..4c25d14aaf 100644 --- a/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/logger.rs +++ b/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/common/logger.rs @@ -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]")) } }