mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 15:11:52 +02:00
Clean up some unwraps (#1147)
This commit is contained in:
@ -422,9 +422,11 @@ pub async fn cli() -> Result<(), Box<dyn Error>> {
|
||||
};
|
||||
|
||||
let prompt = {
|
||||
let bytes = strip_ansi_escapes::strip(&colored_prompt).unwrap();
|
||||
|
||||
String::from_utf8_lossy(&bytes).to_string()
|
||||
if let Ok(bytes) = strip_ansi_escapes::strip(&colored_prompt) {
|
||||
String::from_utf8_lossy(&bytes).to_string()
|
||||
} else {
|
||||
"> ".to_string()
|
||||
}
|
||||
};
|
||||
|
||||
rl.helper_mut().expect("No helper").colored_prompt = colored_prompt;
|
||||
|
Reference in New Issue
Block a user