Skip to content

timglabisch/rust_yolo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Rust Yolo

this crate allows using yolo instead of the unwrap function for Option and Result<T, E> example:

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

special thanks to matthiasendler who recognized how important this crate is

About

Rust's .yolo()

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages