Replaces an object by another one.
fn replace<T>(dst: &mut T, val: T) -> T
The object whose content will be replaced.
The object that will be stored in dst.
dst
Returns the old value in dst.