Function lrs::mem::replace

Replaces an object by another one.

Syntax

fn replace<T>(dst: &mut T, val: T) -> T

Arguments

NameDescription
dst

The object whose content will be replaced.

val

The object that will be stored in dst.

Return value

Returns the old value in dst.