minor: Further simplify take_with

This commit is contained in:
Blaž Hrastnik 2021-10-25 12:07:49 +09:00
parent 2505802d39
commit e36ad8b4ed

View file

@ -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;