General code cleanup

This commit is contained in:
Zhaofeng Li 2022-01-05 14:01:05 -08:00
parent 62cf77a8b6
commit da7907c874
4 changed files with 4 additions and 9 deletions

View file

@ -14,7 +14,7 @@ use crate::progress::SimpleProgressOutput;
use crate::nix::{NixError, NodeFilter}; use crate::nix::{NixError, NodeFilter};
use crate::util; use crate::util;
pub fn register_deploy_args<'a>(command: App<'a>) -> App<'a> { pub fn register_deploy_args(command: App) -> App {
command command
.arg(Arg::new("eval-node-limit") .arg(Arg::new("eval-node-limit")
.long("eval-node-limit") .long("eval-node-limit")

View file

@ -382,10 +382,7 @@ impl JobMonitor {
metadata.custom_message = message; metadata.custom_message = message;
} }
let metadata = if new_state == JobState::Waiting { if new_state != JobState::Waiting {
// Waiting state doesn't generate user-visible output
metadata
} else {
if let Some(sender) = &self.progress { if let Some(sender) = &self.progress {
let text = if new_state == JobState::Succeeded { let text = if new_state == JobState::Succeeded {
metadata.custom_message.clone() metadata.custom_message.clone()
@ -406,8 +403,6 @@ impl JobMonitor {
sender.send(message).unwrap(); sender.send(message).unwrap();
} }
} }
metadata
}; };
self.jobs.insert(job_id, metadata); self.jobs.insert(job_id, metadata);

View file

@ -100,7 +100,7 @@ impl TryFrom<BuildResult<Profile>> for Profile {
}); });
} }
let path = paths.into_iter().next() let path = paths.iter().next()
.unwrap().to_owned(); .unwrap().to_owned();
Ok(Self::from_store_path_unchecked(path)) Ok(Self::from_store_path_unchecked(path))

View file

@ -157,7 +157,7 @@ pub async fn hive_from_args(args: &ArgMatches) -> NixResult<Hive> {
Ok(hive) Ok(hive)
} }
pub fn register_selector_args<'a>(command: App<'a>) -> App<'a> { pub fn register_selector_args(command: App) -> App {
command command
.arg(Arg::new("on") .arg(Arg::new("on")
.long("on") .long("on")