Skip to content

Commit

Permalink
Get rid of unwrap()
Browse files Browse the repository at this point in the history
  • Loading branch information
ysthakur committed Aug 29, 2023
1 parent d70d216 commit 22609d0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1713,7 +1713,15 @@ impl Reedline {
self.hide_hints = true;
// Additional repaint to show the content without hints etc.
if let Some(transient_prompt) = &self.transient_prompt {
self.repaint(transient_prompt.clone().lock().unwrap().as_ref())?
match transient_prompt.clone().lock() {
Ok(transient_prompt) => {
self.repaint(transient_prompt.as_ref())?;
}
Err(_) => {
// TODO log error
self.repaint(prompt)?;
}
}
} else {
self.repaint(prompt)?;
}
Expand Down

0 comments on commit 22609d0

Please sign in to comment.