From e36ad8b4edcede174ffad404b70d7c12d007548e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Mon, 25 Oct 2021 12:07:49 +0900 Subject: [PATCH] minor: Further simplify take_with --- helix-view/src/document.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index 23c2dbc6b..b0257f031 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -311,8 +311,7 @@ where T: Default, F: FnOnce(T) -> T, { - let t = mem::take(mut_ref); - let _ = mem::replace(mut_ref, f(t)); + *mut_ref = f(mem::take(mut_ref)); } use helix_lsp::lsp;