https://github.com/lambda-fairy/if_chain
Macro for writing nested `if let` expressions
https://github.com/lambda-fairy/if_chain
macro rust
Last synced: 9 months ago
JSON representation
Macro for writing nested `if let` expressions
- Host: GitHub
- URL: https://github.com/lambda-fairy/if_chain
- Owner: lambda-fairy
- License: apache-2.0
- Created: 2016-12-28T22:40:27.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2023-09-11T08:57:51.000Z (over 2 years ago)
- Last Synced: 2025-04-03T16:11:15.795Z (9 months ago)
- Topics: macro, rust
- Language: Rust
- Homepage: https://docs.rs/if_chain
- Size: 33.2 KB
- Stars: 165
- Watchers: 6
- Forks: 9
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# if_chain
[](https://github.com/lambda-fairy/if_chain/actions/workflows/ci.yml) [](https://crates.io/crates/if_chain)
This crate provides a single macro called `if_chain!`.
`if_chain!` lets you write long chains of nested `if` and `if let` statements without the associated rightward drift. It also supports multiple patterns (e.g. `if let Foo(a) | Bar(a) = b`) in places where Rust would normally not allow them.
For more information on this crate, see the [documentation](https://docs.rs/if_chain) and associated [blog post](https://lambda.xyz/blog/if-chain).