mirror of
https://github.com/helix-editor/helix.git
synced 2025-01-19 13:37:06 +04:00
minor: Further simplify take_with
This commit is contained in:
parent
2505802d39
commit
e36ad8b4ed
@ -311,8 +311,7 @@ fn take_with<T, F>(mut_ref: &mut T, f: F)
|
|||||||
T: Default,
|
T: Default,
|
||||||
F: FnOnce(T) -> T,
|
F: FnOnce(T) -> T,
|
||||||
{
|
{
|
||||||
let t = mem::take(mut_ref);
|
*mut_ref = f(mem::take(mut_ref));
|
||||||
let _ = mem::replace(mut_ref, f(t));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
use helix_lsp::lsp;
|
use helix_lsp::lsp;
|
||||||
|
Loading…
Reference in New Issue
Block a user