Use std::mem::take instead of defining it

This commit is contained in:
Simon Sapin 2019-11-26 11:24:53 +01:00
parent b2b3ea992c
commit 80eec48d37
3 changed files with 5 additions and 15 deletions

View file

@ -81,12 +81,3 @@ fn relative_adjustement(
block: adjust(box_offsets.block_start, box_offsets.block_end),
}
}
// FIXME: use std::mem::take when its stable.
// https://github.com/rust-lang/rust/issues/61129
fn take<T>(x: &mut T) -> T
where
T: Default,
{
std::mem::replace(x, Default::default())
}