take-cell-option 0.1.2

Utility for taking the value from a cell of a option without cloning.
Documentation

Take Cell Option

Utility for taking the value from a cell of a option without cloning.

Usage

Add take-cell-option = "0.1" to your dependencies.

Example

use take_cell_option::take;
use core::cell::Cell;

let cell = Cell::new(Some(Box::new(10)));
let v = take(&cell);
assert_eq!(*v.unwrap(), 10);
assert!(cell.into_inner().is_none());