treewide: format; minor fixes

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iad55f84850587e9a0862882fd03df5596a6a6964
This commit is contained in:
raf 2025-12-17 11:57:08 +03:00
commit 0eac066a04
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
3 changed files with 12 additions and 12 deletions

View file

@ -254,7 +254,8 @@ pub fn run() -> eyre::Result<()> {
/// ///
/// Everything before `--` is for the package name and rom arguments. /// Everything before `--` is for the package name and rom arguments.
/// Everything after `--` goes directly to nix. /// Everything after `--` goes directly to nix.
#[must_use] pub fn parse_args_with_separator( #[must_use]
pub fn parse_args_with_separator(
args: &[String], args: &[String],
) -> (Vec<String>, Vec<String>) { ) -> (Vec<String>, Vec<String>) {
if let Some(pos) = args.iter().position(|arg| arg == "--") { if let Some(pos) = args.iter().position(|arg| arg == "--") {
@ -582,9 +583,7 @@ fn run_monitored_command(
|| !state.full_summary.planned_builds.is_empty(); || !state.full_summary.planned_builds.is_empty();
if !silent { if !silent {
if has_activity if has_activity || state.progress_state != ProgressState::JustStarted {
|| state.progress_state != ProgressState::JustStarted
{
// Clear any previous timer display // Clear any previous timer display
if last_timer_display.is_some() { if last_timer_display.is_some() {
display.clear_previous().ok(); display.clear_previous().ok();

View file

@ -14,7 +14,8 @@ use crossterm::{
use crate::state::{BuildStatus, DerivationId, State, current_time}; use crate::state::{BuildStatus, DerivationId, State, current_time};
/// Format a duration in seconds to a human-readable string /// 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 { if secs < 60.0 {
format!("{secs:.0}s") format!("{secs:.0}s")
} else if secs < 3600.0 { } else if secs < 3600.0 {
@ -860,8 +861,6 @@ impl<W: Write> Display<W> {
lines lines
} }
fn build_active_forest( fn build_active_forest(
&self, &self,
state: &State, state: &State,

View file

@ -23,7 +23,8 @@ pub enum SummaryStyle {
} }
impl 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() { match s.to_lowercase().as_str() {
"concise" => Self::Concise, "concise" => Self::Concise,
"table" => Self::Table, "table" => Self::Table,
@ -34,7 +35,8 @@ impl SummaryStyle {
} }
impl DisplayFormat { 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() { match s.to_lowercase().as_str() {
"tree" => Self::Tree, "tree" => Self::Tree,
"plain" => Self::Plain, "plain" => Self::Plain,