From 1ca0fb73277e75de40c612036db2e5c126139947 Mon Sep 17 00:00:00 2001 From: iVacon Date: Thu, 8 Jun 2023 15:42:43 +0300 Subject: [PATCH] Program can now run without figlet --- src/main.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0d42088..6fb9398 100644 --- a/src/main.rs +++ b/src/main.rs @@ -45,10 +45,12 @@ fn main() { let figlet = Command::new("figlet") .args(["-f", "smslant", &distro_name.clone()]) .output(); - - let figlet = figlet.unwrap(); - let figlet = String::from_utf8_lossy(&figlet.stdout); + if figlet.is_err() == false { + let figlet = figlet.unwrap(); + let figlet = String::from_utf8_lossy(&figlet.stdout); + print!("{}", figlet); + } // Print all the things we've been saving. print!("{}", figlet); println!("{}@{}", user.clone().trim(), hostname.clone().trim());