diff --git a/src/utils/formatting.rs b/src/utils/formatting.rs index 8c045ca9..8283ad5b 100644 --- a/src/utils/formatting.rs +++ b/src/utils/formatting.rs @@ -45,11 +45,11 @@ impl Display for EscapedPathDisplay<'_> { /// This is different from [`Path::display`]. /// /// See for a comparison. -pub fn path_to_str(path: &Path) -> Cow { +pub fn path_to_str(path: &Path) -> Cow<'_, str> { os_str_to_str(path.as_ref()) } -pub fn os_str_to_str(os_str: &OsStr) -> Cow { +pub fn os_str_to_str(os_str: &OsStr) -> Cow<'_, str> { let format = || { let text = format!("{os_str:?}"); Cow::Owned(text.trim_matches('"').to_string()) @@ -83,7 +83,7 @@ pub fn pretty_format_list_of_paths(paths: &[impl AsRef]) -> String { } /// Display the directory name, but use "current directory" when necessary. -pub fn nice_directory_display(path: &Path) -> Cow { +pub fn nice_directory_display(path: &Path) -> Cow<'_, str> { if path == Path::new(".") { Cow::Borrowed("current directory") } else { diff --git a/src/utils/logger.rs b/src/utils/logger.rs index 94251415..ad69e2f0 100644 --- a/src/utils/logger.rs +++ b/src/utils/logger.rs @@ -5,7 +5,7 @@ use std::{ pub use logger_thread::spawn_logger_thread; -use super::colors::{ORANGE, RESET, YELLOW}; +use super::colors::{GREEN, ORANGE, RESET}; use crate::accessible::is_running_in_accessible_mode; /// Asks logger to shutdown and waits till it flushes all pending messages. @@ -84,12 +84,12 @@ impl PrintMessage { MessageLevel::Info => { if self.accessible { if is_running_in_accessible_mode() { - Some(format!("{}Info:{} {}", *YELLOW, *RESET, self.contents)) + Some(format!("{}Info:{} {}", *GREEN, *RESET, self.contents)) } else { - Some(format!("{}[INFO]{} {}", *YELLOW, *RESET, self.contents)) + Some(format!("{}[INFO]{} {}", *GREEN, *RESET, self.contents)) } } else if !is_running_in_accessible_mode() { - Some(format!("{}[INFO]{} {}", *YELLOW, *RESET, self.contents)) + Some(format!("{}[INFO]{} {}", *GREEN, *RESET, self.contents)) } else { None }