option-ext
This crate extends Option
with additional methods, currently:
contains
Its sister crate is result-ext
, which extends Result
.
Rust 1.0 or newer.
Add the library as a dependency to your project by inserting
toml
option-ext = "0.1.0"
into the [dependencies]
section of your Cargo.toml file.
```rust use self::option_ext;
fn example() {
let x: Option
let x: Option<u32> = Some(3);
assert_eq!(x.contains(&2), false);
let x: Option<u32> = None;
assert_eq!(x.contains(&2), false);
} ```