From a086b4c10020ddbf724d726da0fd290058097822 Mon Sep 17 00:00:00 2001 From: ysthakur <45539777+ysthakur@users.noreply.github.com> Date: Tue, 12 Sep 2023 15:59:22 -0400 Subject: [PATCH] Use Option.take instead of mem::replace --- src/engine.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine.rs b/src/engine.rs index ea9c2448..94d4d0c9 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -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 {