Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tranzystorekk/option-extra

Additional utilities for Rust's common std types
https://github.com/tranzystorekk/option-extra

contributions-welcome hacktoberfest library rust-lang utilities

Last synced: 21 days ago
JSON representation

Additional utilities for Rust's common std types

Awesome Lists containing this project

README

        

# option-extra

[![CI](https://github.com/tranzystorek-io/option-extra/actions/workflows/ci.yml/badge.svg)](https://github.com/tranzystorek-io/option-extra/actions/workflows/ci.yml)

## About

Additional utilities for common standard types, that feel missing.

## Usage

New methods live in the `OptionExt` / `ResultExt` traits:

```rust
use option_extra::OptionExt;

assert_eq!(Some(1).zip_lazy(|| Some("abcd")), Some((1, "abcd")));
```

```rust
use option_extra::ResultExt;

assert!(Ok::<_, ()>(1).satisfies(|&n| n % 2 == 1));
```

## Contributing

If you want something added to this library, submit a PR or a discussion
in the [Ideas](https://github.com/tranzystorek-io/option-extra/discussions/categories/ideas) channel!