Crates.io | yolo |
lib.rs | yolo |
version | 0.1.2 |
source | src |
created_at | 2016-02-08 21:33:06.164708 |
updated_at | 2016-02-08 21:43:46.657281 |
description | Rusts .yolo() |
homepage | https://github.com/timglabisch/rust_yolo |
repository | https://github.com/timglabisch/rust_yolo.git |
max_upload_size | |
id | 4130 |
size | 1,449 |
this crate allows using yolo
instead of the unwrap
function for Option
extern crate yolo;
use yolo::Yolo;
fn get_result(v : i32) -> Result<i32, ()> {
Ok(v)
}
fn main() {
assert_eq!(Some(123).yolo(), 123);
assert_eq!(get_result(123).yolo(), 123);
println!("hello world!");
}
installation
use
[dependencies]
yolo = "*"
make sure you DONT'T pin it to a version -> YOLO!.
special thanks to matthiasendler who recognized how important this crate is