treewide: format; minor fixes
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Iad55f84850587e9a0862882fd03df5596a6a6964
This commit is contained in:
parent
48ee32f3d6
commit
0eac066a04
3 changed files with 12 additions and 12 deletions
|
|
@ -254,7 +254,8 @@ pub fn run() -> eyre::Result<()> {
|
|||
///
|
||||
/// Everything before `--` is for the package name and rom arguments.
|
||||
/// Everything after `--` goes directly to nix.
|
||||
#[must_use] pub fn parse_args_with_separator(
|
||||
#[must_use]
|
||||
pub fn parse_args_with_separator(
|
||||
args: &[String],
|
||||
) -> (Vec<String>, Vec<String>) {
|
||||
if let Some(pos) = args.iter().position(|arg| arg == "--") {
|
||||
|
|
@ -582,9 +583,7 @@ fn run_monitored_command(
|
|||
|| !state.full_summary.planned_builds.is_empty();
|
||||
|
||||
if !silent {
|
||||
if has_activity
|
||||
|| state.progress_state != ProgressState::JustStarted
|
||||
{
|
||||
if has_activity || state.progress_state != ProgressState::JustStarted {
|
||||
// Clear any previous timer display
|
||||
if last_timer_display.is_some() {
|
||||
display.clear_previous().ok();
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ use crossterm::{
|
|||
use crate::state::{BuildStatus, DerivationId, State, current_time};
|
||||
|
||||
/// Format a duration in seconds to a human-readable string
|
||||
#[must_use] pub fn format_duration(secs: f64) -> String {
|
||||
#[must_use]
|
||||
pub fn format_duration(secs: f64) -> String {
|
||||
if secs < 60.0 {
|
||||
format!("{secs:.0}s")
|
||||
} else if secs < 3600.0 {
|
||||
|
|
@ -63,9 +64,9 @@ impl Default for DisplayConfig {
|
|||
}
|
||||
|
||||
pub struct Display<W: Write> {
|
||||
writer: W,
|
||||
config: DisplayConfig,
|
||||
last_lines: usize,
|
||||
writer: W,
|
||||
config: DisplayConfig,
|
||||
last_lines: usize,
|
||||
}
|
||||
|
||||
struct TreeNode {
|
||||
|
|
@ -860,8 +861,6 @@ impl<W: Write> Display<W> {
|
|||
lines
|
||||
}
|
||||
|
||||
|
||||
|
||||
fn build_active_forest(
|
||||
&self,
|
||||
state: &State,
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@ pub enum SummaryStyle {
|
|||
}
|
||||
|
||||
impl SummaryStyle {
|
||||
#[must_use] pub fn from_str(s: &str) -> Self {
|
||||
#[must_use]
|
||||
pub fn from_str(s: &str) -> Self {
|
||||
match s.to_lowercase().as_str() {
|
||||
"concise" => Self::Concise,
|
||||
"table" => Self::Table,
|
||||
|
|
@ -34,7 +35,8 @@ impl SummaryStyle {
|
|||
}
|
||||
|
||||
impl DisplayFormat {
|
||||
#[must_use] pub fn from_str(s: &str) -> Self {
|
||||
#[must_use]
|
||||
pub fn from_str(s: &str) -> Self {
|
||||
match s.to_lowercase().as_str() {
|
||||
"tree" => Self::Tree,
|
||||
"plain" => Self::Plain,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue