aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-10-25 03:07:49 +0000
committerBlaž Hrastnik2021-10-27 03:25:00 +0000
commite36ad8b4edcede174ffad404b70d7c12d007548e (patch)
treed6ffc9ae290cc9876336cd37cdb5061ed34fa464 /helix-view/src
parent2505802d39f18f2f2dcfe8e00633f895c67beb76 (diff)
minor: Further simplify take_with
Diffstat (limited to 'helix-view/src')
-rw-r--r--helix-view/src/document.rs3
1 files changed, 1 insertions, 2 deletions
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;