diff --git a/pfetch-logo-parser/src/lib.rs b/pfetch-logo-parser/src/lib.rs index 801361c..caf4fe3 100644 --- a/pfetch-logo-parser/src/lib.rs +++ b/pfetch-logo-parser/src/lib.rs @@ -95,8 +95,8 @@ impl Display for Logo { "{}", self.logo_parts .iter() - .map(|LogoPart { color, content }| format!("{color}{content}")) - .collect::() + .fold("".to_string(), |a, LogoPart { color, content }| a + + &format!("{color}{content}")) ) } } diff --git a/src/lib.rs b/src/lib.rs index b12322c..9f7053d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -370,10 +370,7 @@ pub fn de(general_readout: &GeneralReadout) -> Option { } pub fn palette() -> String { - (1..7) - .map(|num| format!("\x1b[4{num}m ")) - .collect::() - + "\x1b[0m" + (1..7).fold("".to_string(), |a, e| a + &format!("\x1b[4{e}m ")) + "\x1b[0m" } fn run_system_command(command: &str, args: &[&str]) -> Result {