Skip to content

Commit

Permalink
Use Option.take instead of mem::replace
Browse files Browse the repository at this point in the history
  • Loading branch information
ysthakur committed Sep 12, 2023
1 parent c567bce commit a086b4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,7 @@ impl Reedline {
let buffer = self.editor.get_buffer().to_string();
self.hide_hints = true;
// Additional repaint to show the content without hints etc.
if let Some(transient_prompt) = std::mem::replace(&mut self.transient_prompt, None) {
if let Some(transient_prompt) = self.transient_prompt.take() {
self.repaint(transient_prompt.as_ref())?;
self.transient_prompt = Some(transient_prompt);
} else {
Expand Down

0 comments on commit a086b4c

Please sign in to comment.