clippy: if _ then _ ... is an expression
This commit is contained in:
parent
8fe689989a
commit
2b338c3549
4 changed files with 18 additions and 27 deletions
|
@ -51,9 +51,8 @@ fn main() {
|
|||
})
|
||||
.unwrap();
|
||||
|
||||
let queue_name: String;
|
||||
if cfg.runner.build_all_jobs != Some(true) {
|
||||
queue_name = channel
|
||||
let queue_name: String = if cfg.runner.build_all_jobs != Some(true) {
|
||||
channel
|
||||
.declare_queue(easyamqp::QueueConfig {
|
||||
queue: format!("build-inputs-{}", cfg.nix.system.clone()),
|
||||
passive: false,
|
||||
|
@ -63,11 +62,11 @@ fn main() {
|
|||
no_wait: false,
|
||||
arguments: None,
|
||||
})
|
||||
.unwrap().queue;
|
||||
.unwrap().queue
|
||||
} else {
|
||||
warn!("Building all jobs, please don't use this unless you're");
|
||||
warn!("developing and have Graham's permission!");
|
||||
queue_name = channel
|
||||
channel
|
||||
.declare_queue(easyamqp::QueueConfig {
|
||||
queue: "".to_owned(),
|
||||
passive: false,
|
||||
|
@ -77,8 +76,8 @@ fn main() {
|
|||
no_wait: false,
|
||||
arguments: None,
|
||||
})
|
||||
.unwrap().queue;
|
||||
}
|
||||
.unwrap().queue
|
||||
};
|
||||
|
||||
channel
|
||||
.bind_queue(easyamqp::BindQueueConfig {
|
||||
|
|
|
@ -204,14 +204,11 @@ impl Nix {
|
|||
let stderr = tempfile().expect("Fetching a stderr tempfile");
|
||||
let mut reader = stderr.try_clone().expect("Cloning stderr to the reader");
|
||||
|
||||
let stdout: Stdio;
|
||||
|
||||
if keep_stdout {
|
||||
let stdout_fd = stderr.try_clone().expect("Cloning stderr for stdout");
|
||||
stdout = Stdio::from(stdout_fd);
|
||||
let stdout: Stdio = if keep_stdout {
|
||||
Stdio::from(stderr.try_clone().expect("Cloning stderr for stdout"))
|
||||
} else {
|
||||
stdout = Stdio::null();
|
||||
}
|
||||
Stdio::null()
|
||||
};
|
||||
|
||||
let status = cmd.stdout(Stdio::from(stdout))
|
||||
.stderr(Stdio::from(stderr))
|
||||
|
|
|
@ -161,13 +161,11 @@ impl OutPaths {
|
|||
}
|
||||
|
||||
fn execute(&self) -> Result<File, File> {
|
||||
let check_meta: String;
|
||||
|
||||
if self.check_meta {
|
||||
check_meta = String::from("true");
|
||||
let check_meta: String = if self.check_meta {
|
||||
String::from("true")
|
||||
} else {
|
||||
check_meta = String::from("false");
|
||||
}
|
||||
String::from("false")
|
||||
};
|
||||
|
||||
self.nix.safely(
|
||||
nix::Operation::QueryPackagesOutputs,
|
||||
|
|
|
@ -115,9 +115,7 @@ fn result_to_check(result: &LegacyBuildResult, timestamp: DateTime<Utc>) -> Chec
|
|||
&skipped));
|
||||
}
|
||||
|
||||
let text: String;
|
||||
|
||||
if !result.output.is_empty() {
|
||||
let text: String = if !result.output.is_empty() {
|
||||
let mut reply: Vec<String> = vec![];
|
||||
|
||||
reply.push("## Partial log".to_owned());
|
||||
|
@ -126,11 +124,10 @@ fn result_to_check(result: &LegacyBuildResult, timestamp: DateTime<Utc>) -> Chec
|
|||
reply.extend(result.output.clone());
|
||||
reply.push("```".to_owned());
|
||||
|
||||
text = reply.join("\n");
|
||||
reply.join("\n")
|
||||
} else {
|
||||
text = String::from("No partial log is available.");
|
||||
}
|
||||
|
||||
String::from("No partial log is available.")
|
||||
};
|
||||
|
||||
CheckRunOptions{
|
||||
name: format!(
|
||||
|
|
Loading…
Reference in a new issue