https://github.com/btwiuse/nothing
Probably a better Option.
https://github.com/btwiuse/nothing
nothing option rust-crate
Last synced: about 1 year ago
JSON representation
Probably a better Option.
- Host: GitHub
- URL: https://github.com/btwiuse/nothing
- Owner: btwiuse
- License: mit
- Created: 2022-04-04T01:51:29.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-04T14:25:44.000Z (over 2 years ago)
- Last Synced: 2025-06-04T13:30:54.979Z (about 1 year ago)
- Topics: nothing, option, rust-crate
- Language: Rust
- Homepage: https://crates.io/crates/nothing
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
nothing
=======
[](https://crates.io/crates/nothing)
[](https://docs.rs/nothing)
[](https://travis-ci.org/btwiuse/nothing)
nothing::[Probably] is a better [Option].
```
pub enum Probably {
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](https://github.com/btwiuse/nothing/blob/master/examples/main.rs)

## Not convinced?
Real-world examples:
- [that](https://crates.io/crates/that)
Probably nothing.