Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/utils/formatting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ impl Display for EscapedPathDisplay<'_> {
/// This is different from [`Path::display`].
///
/// See <https://gist.github.com/marcospb19/ebce5572be26397cf08bbd0fd3b65ac1> for a comparison.
pub fn path_to_str(path: &Path) -> Cow<str> {
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<str> {
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())
Expand Down Expand Up @@ -83,7 +83,7 @@ pub fn pretty_format_list_of_paths(paths: &[impl AsRef<Path>]) -> String {
}

/// Display the directory name, but use "current directory" when necessary.
pub fn nice_directory_display(path: &Path) -> Cow<str> {
pub fn nice_directory_display(path: &Path) -> Cow<'_, str> {
if path == Path::new(".") {
Cow::Borrowed("current directory")
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/utils/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
}
Expand Down
Loading