Make clippy happy

This commit is contained in:
Graham Christensen 2019-03-22 17:26:43 -04:00
parent 6cbaa5d5c6
commit 542e66fcf5
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
4 changed files with 8 additions and 5 deletions

View file

@ -148,7 +148,7 @@ impl RebuildTagger {
Default::default() Default::default()
} }
pub fn parse_attrs(&mut self, attrs: &Vec<PackageArch>) { pub fn parse_attrs(&mut self, attrs: Vec<PackageArch>) {
let mut counter_darwin = 0; let mut counter_darwin = 0;
let mut counter_linux = 0; let mut counter_linux = 0;

View file

@ -5,6 +5,7 @@ use ofborg::message::buildjob::BuildJob;
use std::path::Path; use std::path::Path;
use tasks::eval::{EvaluationStrategy, StepResult}; use tasks::eval::{EvaluationStrategy, StepResult};
#[derive(Default)]
pub struct GenericStrategy {} pub struct GenericStrategy {}
impl GenericStrategy { impl GenericStrategy {
pub fn new() -> GenericStrategy { pub fn new() -> GenericStrategy {

View file

@ -36,7 +36,9 @@ pub struct NixpkgsStrategy<'a> {
changed_paths: Option<Vec<String>>, changed_paths: Option<Vec<String>>,
touched_packages: Option<Vec<String>>, touched_packages: Option<Vec<String>>,
} }
impl<'a> NixpkgsStrategy<'a> { impl<'a> NixpkgsStrategy<'a> {
#[allow(clippy::too_many_arguments)]
pub fn new( pub fn new(
job: &'a EvaluationJob, job: &'a EvaluationJob,
pull: &'a hubcaps::pulls::PullRequest, pull: &'a hubcaps::pulls::PullRequest,
@ -182,7 +184,7 @@ impl<'a> NixpkgsStrategy<'a> {
self.record_impacted_maintainers(&dir, &attrs); self.record_impacted_maintainers(&dir, &attrs);
} }
rebuild_tags.parse_attrs(&attrs); rebuild_tags.parse_attrs(attrs.clone());
} }
update_labels( update_labels(
@ -193,7 +195,7 @@ impl<'a> NixpkgsStrategy<'a> {
} }
} }
fn gist_changed_paths(&self, attrs: &Vec<PackageArch>) -> Option<String> { fn gist_changed_paths(&self, attrs: &[PackageArch]) -> Option<String> {
make_gist( make_gist(
&self.gists, &self.gists,
"Changed Paths", "Changed Paths",
@ -206,7 +208,7 @@ impl<'a> NixpkgsStrategy<'a> {
) )
} }
fn record_impacted_maintainers(&self, dir: &Path, attrs: &Vec<PackageArch>) -> () { fn record_impacted_maintainers(&self, dir: &Path, attrs: &[PackageArch]) {
let changed_attributes = attrs let changed_attributes = attrs
.iter() .iter()
.map(|attr| attr.package.split('.').collect::<Vec<&str>>()) .map(|attr| attr.package.split('.').collect::<Vec<&str>>())

View file

@ -250,7 +250,7 @@ impl<E: stats::SysEvents + 'static> worker::SimpleWorker for EvaluationWorker<E>
info!("Failed to merge {}", job.pr.head_sha); info!("Failed to merge {}", job.pr.head_sha);
evaluaton_strategy.merge_conflict(); evaluation_strategy.merge_conflict();
return self.actions().skip(&job); return self.actions().skip(&job);
} }