simple-bind: one-line non-exhaustive binds in Rust
Nightly-only crate.
// Here's a brief example that demonstrates how simple-bind works.
extern crate simple_bind;
use bind;
Setup
Use of this crate uses the unstable proc_macro
API, so it requires nightly and a few feature gates.
Enable nightly on your repository:
rustup override set nightly
Add this line to your cargo.toml
:
[]
= "0.1.4"
To your main module file (lib.rs
or main.rs
), add:
extern crate simple_bind;
Then wherever you want to use the macro, use normal imports (i.e. not #[macro_use]
):
use bind;
Examples
Issues
This implementation just covers cases I've run in to, and is not exhaustive to all possible binds. If you find a problem, feel free to submit an issue or a PR!