From 72e9a5d40f9383b2a5b16285c1e43197815eec21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Tue, 24 Jun 2025 01:28:09 +0000 Subject: [PATCH] styling/doc --- src/main.rs | 9 +++++---- src/output.rs | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 8d5c73c..ac8c9b3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,7 +15,7 @@ use std::{ }; use clap::Parser; -use console::style; +use console::{StyledObject, style}; use log::{info, trace}; use appstate::AppState; @@ -73,7 +73,7 @@ fn main() { info!("continuing with state: {state:#?}"); - let fns_magenta = output::style_all(&args.file_names(), |s| style(s).magenta()).join(", "); + let fns_magenta = output::style_all(&args.file_names(), StyledObject::magenta).join(", "); println!("{} is uploading: {fns_magenta}", *SHRUPL); @@ -91,14 +91,15 @@ fn main() { if let ClientError::InvalidParameter(p) = e { match p { - // TODO Error 404: File not found + // Error 404 (File not found) Parameter::FileID(fid) => { trace!("requeueing file {fid:?}"); state.abort_upload(); } - // TODO Error 404: Share not found + // Error 404 (Share not found) Parameter::ShareID(sid) => { + // TODO ask trace!("rebuilding share {sid:?}"); // rebuild share diff --git a/src/output.rs b/src/output.rs index 1c28fd0..0ca1038 100644 --- a/src/output.rs +++ b/src/output.rs @@ -38,9 +38,9 @@ pub fn prompt_continue() -> bool { pub fn style_all<'t, F>(strs: &[&'t str], f: F) -> Vec where - F: Fn(&'t str) -> StyledObject<&'t str>, + F: Fn(StyledObject<&'t str>) -> StyledObject<&'t str>, { - strs.iter().map(|&s| f(s).to_string()).collect() + strs.iter().map(|&s| f(style(s)).to_string()).collect() } pub enum Log {}