Skip to content

btwiuse/nothing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nothing

crates.io Documentation Build Status

nothing::[Probably] is a better [Option].

pub enum Probably<T> {
    Nothing,
    Something(T),
}

Why?

The point is that you can use [Probably] as the return type of your main function:

use nothing::{Probably, Nothing};

fn main() -> Probably<()> {
    Nothing
}

Exit code is 0 if it is [Something], 1 if [Nothing].

You can even use the ? operator the way you would with [Option] and [Result]. See ./examples/main.rs

Probably::Nothing

Not convinced?

Real-world examples:

Probably nothing.

Releases

No releases published

Packages

No packages published

Languages