diff --git a/ofborg/src/acl.rs b/ofborg/src/acl.rs index d05a3c1..a1c58bc 100644 --- a/ofborg/src/acl.rs +++ b/ofborg/src/acl.rs @@ -14,9 +14,9 @@ impl ACL { trusted_users.iter_mut().map(|x| *x = x.to_lowercase()).last(); known_users.iter_mut().map(|x| *x = x.to_lowercase()).last(); return ACL { - trusted_users: trusted_users, - known_users: known_users, - repos: repos, + trusted_users, + known_users, + repos, }; } diff --git a/ofborg/src/checkout.rs b/ofborg/src/checkout.rs index 14cb651..1d2cf25 100644 --- a/ofborg/src/checkout.rs +++ b/ofborg/src/checkout.rs @@ -41,7 +41,7 @@ impl CachedCloner { return CachedProject { root: new_root, - clone_url: clone_url, + clone_url, }; } } @@ -55,7 +55,7 @@ impl CachedProject { return Ok(CachedProjectCo { root: new_root, - id: id, + id, clone_url: self.clone_from().clone(), local_reference: self.clone_to().clone(), }); diff --git a/ofborg/src/commitstatus.rs b/ofborg/src/commitstatus.rs index e338324..ce7b888 100644 --- a/ofborg/src/commitstatus.rs +++ b/ofborg/src/commitstatus.rs @@ -20,10 +20,10 @@ impl<'a> CommitStatus<'a> { url: Option, ) -> CommitStatus<'a> { let mut stat = CommitStatus { - api: api, - sha: sha, - context: context, - description: description, + api, + sha, + context, + description, url: "".to_owned(), }; diff --git a/ofborg/src/easyamqp.rs b/ofborg/src/easyamqp.rs index d729619..ead4845 100644 --- a/ofborg/src/easyamqp.rs +++ b/ofborg/src/easyamqp.rs @@ -304,8 +304,8 @@ pub fn session_from_config(config: &RabbitMQConfig) -> Result, nix: nix::Nix) -> EvalChecker { EvalChecker { name: name.to_owned(), - op: op, - args: args, - nix: nix, + op, + args, + nix, } } diff --git a/ofborg/src/message/buildjob.rs b/ofborg/src/message/buildjob.rs index 20e7bcc..1e19f0c 100644 --- a/ofborg/src/message/buildjob.rs +++ b/ofborg/src/message/buildjob.rs @@ -35,15 +35,15 @@ impl BuildJob { ).to_lowercase(); BuildJob { - repo: repo, - pr: pr, + repo, + pr, subset: Some(subset), - attrs: attrs, + attrs, logs: Some(logs.unwrap_or((Some("logs".to_owned()), Some(logbackrk)))), statusreport: Some(statusreport.unwrap_or( (Some("build-results".to_owned()), None), )), - request_id: request_id, + request_id, } } } diff --git a/ofborg/src/nix.rs b/ofborg/src/nix.rs index fb97ab5..0d82492 100644 --- a/ofborg/src/nix.rs +++ b/ofborg/src/nix.rs @@ -76,10 +76,10 @@ pub struct Nix { impl Nix { pub fn new(system: String, remote: String, build_timeout: u16, initial_heap_size: Option) -> Nix { return Nix { - system: system, - remote: remote, - build_timeout: build_timeout, - initial_heap_size: initial_heap_size, + system, + remote, + build_timeout, + initial_heap_size, limit_supported_systems: true, }; } diff --git a/ofborg/src/notifyworker.rs b/ofborg/src/notifyworker.rs index 76bc2ab..a4a66c2 100644 --- a/ofborg/src/notifyworker.rs +++ b/ofborg/src/notifyworker.rs @@ -49,8 +49,8 @@ pub struct ChannelNotificationReceiver<'a> { impl<'a> ChannelNotificationReceiver<'a> { pub fn new(channel: &'a mut Channel, delivery_tag: u64) -> ChannelNotificationReceiver<'a> { return ChannelNotificationReceiver { - channel: channel, - delivery_tag: delivery_tag, + channel, + delivery_tag, }; } } diff --git a/ofborg/src/outpathdiff.rs b/ofborg/src/outpathdiff.rs index 2f7ce9e..7ae800e 100644 --- a/ofborg/src/outpathdiff.rs +++ b/ofborg/src/outpathdiff.rs @@ -122,9 +122,9 @@ pub struct OutPaths { impl OutPaths { pub fn new(nix: nix::Nix, path: PathBuf, check_meta: bool) -> OutPaths { OutPaths { - nix: nix, - path: path, - check_meta: check_meta, + nix, + path, + check_meta, } } diff --git a/ofborg/src/stats.rs b/ofborg/src/stats.rs index f30e1d3..1d1e9ee 100644 --- a/ofborg/src/stats.rs +++ b/ofborg/src/stats.rs @@ -29,7 +29,7 @@ pub struct RabbitMQ { impl RabbitMQ { pub fn new(identity: &str, channel: Channel) -> RabbitMQ { - RabbitMQ { identity: identity.to_owned(), channel: channel } + RabbitMQ { identity: identity.to_owned(), channel, } } } diff --git a/ofborg/src/tasks/build.rs b/ofborg/src/tasks/build.rs index e09d8a0..04d1f33 100644 --- a/ofborg/src/tasks/build.rs +++ b/ofborg/src/tasks/build.rs @@ -32,10 +32,10 @@ impl BuildWorker { identity: String, ) -> BuildWorker { return BuildWorker { - cloner: cloner, - nix: nix, - system: system, - identity: identity, + cloner, + nix, + system, + identity, }; } @@ -83,15 +83,15 @@ impl<'a, 'b> JobActions<'a, 'b> { return JobActions { system: system.to_owned(), identity: identity.to_owned(), - receiver: receiver, - job: job, + receiver, + job, line_counter: 0, snippet_log: VecDeque::with_capacity(10), attempt_id: format!("{}", Uuid::new_v4()), - log_exchange: log_exchange, - log_routing_key: log_routing_key, - result_exchange: result_exchange, - result_routing_key: result_routing_key, + log_exchange, + log_routing_key, + result_exchange, + result_routing_key, }; } @@ -241,7 +241,7 @@ impl<'a, 'b> JobActions<'a, 'b> { output: self.log_snippet(), attempt_id: self.attempt_id.clone(), request_id: self.job.request_id.clone(), - status: status, + status, attempted_attrs: Some(attempted_attrs), skipped_attrs: Some(not_attempted_attrs), }; @@ -496,7 +496,7 @@ mod tests { let job = buildjob::BuildJob { attrs: vec!["success".to_owned()], pr: Pr { - head_sha: head_sha, + head_sha, number: 1, target_branch: Some("master".to_owned()), }, @@ -545,7 +545,7 @@ mod tests { let job = buildjob::BuildJob { attrs: vec!["not-real".to_owned()], pr: Pr { - head_sha: head_sha, + head_sha, number: 1, target_branch: Some("master".to_owned()), }, diff --git a/ofborg/src/tasks/eval/stdenvs.rs b/ofborg/src/tasks/eval/stdenvs.rs index febe2fc..6940007 100644 --- a/ofborg/src/tasks/eval/stdenvs.rs +++ b/ofborg/src/tasks/eval/stdenvs.rs @@ -29,8 +29,8 @@ pub struct Stdenvs { impl Stdenvs { pub fn new(nix: nix::Nix, co: PathBuf) -> Stdenvs { return Stdenvs { - nix: nix, - co: co, + nix, + co, linux_stdenv_before: None, linux_stdenv_after: None, diff --git a/ofborg/src/tasks/evaluationfilter.rs b/ofborg/src/tasks/evaluationfilter.rs index 95f8fab..1bd48cc 100644 --- a/ofborg/src/tasks/evaluationfilter.rs +++ b/ofborg/src/tasks/evaluationfilter.rs @@ -17,7 +17,7 @@ pub struct EvaluationFilterWorker { impl EvaluationFilterWorker { pub fn new(acl: acl::ACL) -> EvaluationFilterWorker { return EvaluationFilterWorker { - acl: acl, + acl, }; } } diff --git a/ofborg/src/tasks/githubcommentfilter.rs b/ofborg/src/tasks/githubcommentfilter.rs index 54ed984..eae3baa 100644 --- a/ofborg/src/tasks/githubcommentfilter.rs +++ b/ofborg/src/tasks/githubcommentfilter.rs @@ -22,8 +22,8 @@ pub struct GitHubCommentWorker { impl GitHubCommentWorker { pub fn new(acl: acl::ACL, github: hubcaps::Github) -> GitHubCommentWorker { return GitHubCommentWorker { - acl: acl, - github: github, + acl, + github, }; } } diff --git a/ofborg/src/tasks/githubcommentposter.rs b/ofborg/src/tasks/githubcommentposter.rs index e649df9..c7c34de 100644 --- a/ofborg/src/tasks/githubcommentposter.rs +++ b/ofborg/src/tasks/githubcommentposter.rs @@ -17,7 +17,7 @@ pub struct GitHubCommentPoster { impl GitHubCommentPoster { pub fn new(github: hubcaps::Github) -> GitHubCommentPoster { - return GitHubCommentPoster { github: github }; + return GitHubCommentPoster { github }; } } diff --git a/ofborg/src/tasks/log_message_collector.rs b/ofborg/src/tasks/log_message_collector.rs index 6baecb2..2f07ea8 100644 --- a/ofborg/src/tasks/log_message_collector.rs +++ b/ofborg/src/tasks/log_message_collector.rs @@ -62,7 +62,7 @@ impl LogMessageCollector { pub fn new(log_root: PathBuf, max_open: usize) -> LogMessageCollector { return LogMessageCollector { handles: LruCache::new(max_open), - log_root: log_root, + log_root, }; } @@ -215,9 +215,9 @@ impl worker::SimpleWorker for LogMessageCollector { return Ok(LogMessage { from: LogFrom { routing_key: deliver.routing_key.clone(), - attempt_id: attempt_id, + attempt_id, }, - message: message + message, }); } diff --git a/ofborg/src/tasks/massrebuilder.rs b/ofborg/src/tasks/massrebuilder.rs index 4d962c9..ebb54f0 100644 --- a/ofborg/src/tasks/massrebuilder.rs +++ b/ofborg/src/tasks/massrebuilder.rs @@ -46,13 +46,13 @@ impl MassRebuildWorker { tag_paths: HashMap>, ) -> MassRebuildWorker { return MassRebuildWorker { - cloner: cloner, + cloner, nix: nix.without_limited_supported_systems(), - github: github, - acl: acl, - identity: identity, - events: events, - tag_paths: tag_paths + github, + acl, + identity, + events, + tag_paths, }; } @@ -609,9 +609,9 @@ fn make_gist<'a>( return Some( gists .create(&hubcaps::gists::GistOptions { - description: description, + description, public: Some(true), - files: files, + files, }) .expect("Failed to create gist!") .html_url, diff --git a/ofborg/src/tasks/statscollector.rs b/ofborg/src/tasks/statscollector.rs index 35f2d36..aaceec1 100644 --- a/ofborg/src/tasks/statscollector.rs +++ b/ofborg/src/tasks/statscollector.rs @@ -14,8 +14,8 @@ pub struct StatCollectorWorker { impl StatCollectorWorker { pub fn new(events: E, collector: stats::MetricCollector) -> StatCollectorWorker { StatCollectorWorker { - events: events, - collector: collector, + events, + collector, } } } diff --git a/ofborg/src/worker.rs b/ofborg/src/worker.rs index 62922ae..d64fb04 100644 --- a/ofborg/src/worker.rs +++ b/ofborg/src/worker.rs @@ -45,8 +45,8 @@ where }; return Action::Publish(QueueMsg { - exchange: exchange, - routing_key: routing_key, + exchange, + routing_key, mandatory: false, immediate: false, properties: Some(props),