Skip to main content

Crate consumable

Crate consumable 

Source
Expand description

Consume the value by replacing it with the default value and returning the previous value

use consumable::*;
 
let mut x : i32 = 42;
assert_eq!(x.consume(), 42);
assert_eq!(x, i32::default());

Traitsยง

Consumable
Consume the value by replacing it with the default value and returning the previous value.