From e36ad8b4edcede174ffad404b70d7c12d007548e Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Mon, 25 Oct 2021 12:07:49 +0900 Subject: minor: Further simplify take_with --- helix-view/src/document.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'helix-view/src/document.rs') diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index 23c2dbc6..b0257f03 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; -- cgit v1.2.3-70-g09d2