diff --git a/ofborg/build.rs b/ofborg/build.rs index 2d96cd1..271335f 100644 --- a/ofborg/build.rs +++ b/ofborg/build.rs @@ -182,7 +182,7 @@ impl Metric { } fn events() -> Vec { - return vec![ + vec![ Metric::ticker( "StatCollectorLegacyEvent", "Number of received legacy events", @@ -346,7 +346,7 @@ fn events() -> Vec { None ), */ - ]; + ] } fn main() { diff --git a/ofborg/src/commentparser.rs b/ofborg/src/commentparser.rs index 31e7989..4f925b3 100644 --- a/ofborg/src/commentparser.rs +++ b/ofborg/src/commentparser.rs @@ -64,14 +64,14 @@ pub fn parse_line(text: &str) -> Option> { } } -#[derive(PartialEq, Debug)] +#[derive(PartialEq, Eq, Debug)] pub enum Instruction { Build(Subset, Vec), Eval, } #[allow(clippy::upper_case_acronyms)] -#[derive(Serialize, Deserialize, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] pub enum Subset { Nixpkgs, NixOS, diff --git a/ofborg/src/ghevent/issuecomment.rs b/ofborg/src/ghevent/issuecomment.rs index 63ae601..317649c 100644 --- a/ofborg/src/ghevent/issuecomment.rs +++ b/ofborg/src/ghevent/issuecomment.rs @@ -8,7 +8,7 @@ pub struct IssueComment { pub issue: Issue, } -#[derive(Serialize, Deserialize, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] #[serde(rename_all = "snake_case")] pub enum IssueCommentAction { Created, diff --git a/ofborg/src/ghevent/pullrequestevent.rs b/ofborg/src/ghevent/pullrequestevent.rs index 54f7c68..2cc11d2 100644 --- a/ofborg/src/ghevent/pullrequestevent.rs +++ b/ofborg/src/ghevent/pullrequestevent.rs @@ -21,19 +21,19 @@ pub struct BaseChange { pub sha: ChangeWas, } -#[derive(Serialize, Deserialize, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] pub struct ChangeWas { pub from: String, } -#[derive(Serialize, Deserialize, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] #[serde(rename_all = "snake_case")] pub enum PullRequestState { Open, Closed, } -#[derive(Serialize, Deserialize, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] #[serde(rename_all = "snake_case")] pub enum PullRequestAction { Edited, diff --git a/ofborg/src/message/buildresult.rs b/ofborg/src/message/buildresult.rs index 5fbf18f..328c859 100644 --- a/ofborg/src/message/buildresult.rs +++ b/ofborg/src/message/buildresult.rs @@ -2,7 +2,7 @@ use crate::message::{Pr, Repo}; use hubcaps::checks::Conclusion; -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] pub enum BuildStatus { Skipped, Success, diff --git a/ofborg/src/nix.rs b/ofborg/src/nix.rs index 2756a28..30ecfb6 100644 --- a/ofborg/src/nix.rs +++ b/ofborg/src/nix.rs @@ -14,7 +14,7 @@ use std::process::{Command, Stdio}; use tempfile::tempfile; #[allow(clippy::upper_case_acronyms)] -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum File { DefaultNixpkgs, ReleaseNixOS, @@ -95,7 +95,7 @@ impl fmt::Display for Operation { } } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct Nix { pub system: String, remote: String, @@ -348,8 +348,7 @@ impl Nix { fn lines_from_file(file: fs::File) -> Vec { BufReader::new(file) .lines() - .filter(|line| line.is_ok()) - .map(|line| line.unwrap()) + .filter_map(|line| line.ok()) .filter(|msg| !is_user_setting_warning(msg)) .collect() } diff --git a/ofborg/src/tasks/eval/stdenvs.rs b/ofborg/src/tasks/eval/stdenvs.rs index dbd23b1..01703ec 100644 --- a/ofborg/src/tasks/eval/stdenvs.rs +++ b/ofborg/src/tasks/eval/stdenvs.rs @@ -16,7 +16,7 @@ pub enum System { X8664Linux, } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct Stdenvs { nix: nix::Nix, co: PathBuf, diff --git a/ofborg/src/tasks/evaluationfilter.rs b/ofborg/src/tasks/evaluationfilter.rs index 6e34e7d..b45bebb 100644 --- a/ofborg/src/tasks/evaluationfilter.rs +++ b/ofborg/src/tasks/evaluationfilter.rs @@ -91,10 +91,10 @@ impl worker::SimpleWorker for EvaluationFilterWorker { pr: pr_msg, }; - return vec![ + vec![ worker::publish_serde_action(None, Some("mass-rebuild-check-jobs".to_owned()), &msg), worker::Action::Ack, - ]; + ] } } diff --git a/ofborg/src/worker.rs b/ofborg/src/worker.rs index bf4f3bc..ec63dc7 100644 --- a/ofborg/src/worker.rs +++ b/ofborg/src/worker.rs @@ -6,7 +6,7 @@ pub struct Response {} pub type Actions = Vec; -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum Action { Ack, NackRequeue, @@ -14,7 +14,7 @@ pub enum Action { Publish(Box), } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct QueueMsg { pub exchange: Option, pub routing_key: Option,