if_chain

Crates.ioif_chain
lib.rsif_chain
version1.0.3
created_at2016-12-28 22:56:06.959949+00
updated_at2025-08-29 15:19:03.717105+00
descriptionMacro for writing nested `if let` expressions.
homepage
repositoryhttps://github.com/lambda-fairy/if_chain
max_upload_size
id7826
size24,483
Chris Wong (lambda-fairy)

documentation

https://docs.rs/if_chain

README

if_chain

CI Cargo

If you're using Rust 1.88 or newer, check out if let chains instead. This crate is still available for earlier versions of Rust.

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 and associated blog post.

Commit count: 30

cargo fmt