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

https://github.com/zesterer/nab


https://github.com/zesterer/nab

Last synced: 10 months ago
JSON representation

Awesome Lists containing this project

README

          

# Nab

A macro that makes extracting elements from enum variants simpler.

```rust
enum Foo {
A(i32, bool),
B(bool, u64),
}

let input = Foo::A(42, false);
let output = nab!(input, Foo::A(x, y) => (x, y));
assert_eq!(output, Some((42, false)));
```