option-filter
This crate adds a .filter()
method to Option<T>
.
See the Rust RFCs issue for the motivation behind this crate.
Usage
To use it, add option-filter
to your Cargo.toml
:
[]
= "1.0"
Then import the extension trait:
extern crate option_filter;
use OptionFilterExt;
Now you can filter your Option
s!
let answer = Some;
assert_eq!;
assert_eq!;