From f2c3dc3fa44666af198271e98db47dc354556141 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Wed, 17 Jun 2020 19:02:39 -0700 Subject: [PATCH] *: fix pedantry --- ofborg/build.rs | 4 ++-- ofborg/src/bin/builder.rs | 2 +- ofborg/src/bin/mass-rebuilder.rs | 2 +- ofborg/src/bin/stats.rs | 2 +- ofborg/src/message/buildjob.rs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ofborg/build.rs b/ofborg/build.rs index 677a024..4faa9ee 100644 --- a/ofborg/build.rs +++ b/ofborg/build.rs @@ -168,7 +168,7 @@ impl Metric { MetricType::Ticker(Metric { variant: parts.iter().cloned().collect(), fields: fields - .unwrap_or_else(|| vec![]) + .unwrap_or_default() .iter() .map(|(fieldname, fieldtype)| ((*fieldname).to_string(), (*fieldtype).to_string())) .collect(), @@ -183,7 +183,7 @@ impl Metric { MetricType::Counter(Metric { variant: parts.iter().cloned().collect(), fields: fields - .unwrap_or_else(|| vec![]) + .unwrap_or_default() .iter() .map(|(fieldname, fieldtype)| ((*fieldname).to_string(), (*fieldtype).to_string())) .collect(), diff --git a/ofborg/src/bin/builder.rs b/ofborg/src/bin/builder.rs index 2a22c79..b0e45a0 100644 --- a/ofborg/src/bin/builder.rs +++ b/ofborg/src/bin/builder.rs @@ -44,7 +44,7 @@ fn main() -> Result<(), Box> { })?; let queue_name = if cfg.runner.build_all_jobs != Some(true) { - let queue_name = format!("build-inputs-{}", cfg.nix.system.clone()); + let queue_name = format!("build-inputs-{}", cfg.nix.system); chan.declare_queue(easyamqp::QueueConfig { queue: queue_name.clone(), passive: false, diff --git a/ofborg/src/bin/mass-rebuilder.rs b/ofborg/src/bin/mass-rebuilder.rs index d43cca6..3919703 100644 --- a/ofborg/src/bin/mass-rebuilder.rs +++ b/ofborg/src/bin/mass-rebuilder.rs @@ -39,7 +39,7 @@ fn main() -> Result<(), Box> { let nix = cfg.nix(); let events = stats::RabbitMQ::from_lapin( - &format!("{}-{}", cfg.runner.identity.clone(), cfg.nix.system.clone()), + &format!("{}-{}", cfg.runner.identity, cfg.nix.system), task::block_on(conn.create_channel())?, ); diff --git a/ofborg/src/bin/stats.rs b/ofborg/src/bin/stats.rs index 1650be7..45d8158 100644 --- a/ofborg/src/bin/stats.rs +++ b/ofborg/src/bin/stats.rs @@ -19,7 +19,7 @@ fn main() -> Result<(), Box> { let mut chan = task::block_on(conn.create_channel())?; let events = stats::RabbitMQ::from_lapin( - &format!("{}-{}", cfg.runner.identity.clone(), cfg.nix.system.clone()), + &format!("{}-{}", cfg.runner.identity, cfg.nix.system), task::block_on(conn.create_channel())?, ); diff --git a/ofborg/src/message/buildjob.rs b/ofborg/src/message/buildjob.rs index f9e73d7..f68bc79 100644 --- a/ofborg/src/message/buildjob.rs +++ b/ofborg/src/message/buildjob.rs @@ -32,7 +32,7 @@ impl BuildJob { statusreport: Option, request_id: String, ) -> BuildJob { - let logbackrk = format!("{}.{}", repo.full_name.clone(), pr.number,).to_lowercase(); + let logbackrk = format!("{}.{}", repo.full_name, pr.number).to_lowercase(); BuildJob { repo,