Skip to content

Soft-deprecate this crate #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[![CI](https://github.com/lambda-fairy/if_chain/actions/workflows/ci.yml/badge.svg)](https://github.com/lambda-fairy/if_chain/actions/workflows/ci.yml) [![Cargo](https://img.shields.io/crates/v/if_chain.svg)](https://crates.io/crates/if_chain)

**If you're using Rust 1.62 or newer, check out [`if let` chains](https://github.com/rust-lang/rfcs/blob/master/text/2497-if-let-chains.md) 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.
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
//! This crate provides a single macro called `if_chain!`.
//!
//! **If you're using Rust 1.62 or newer, check out [`if let` chains][rfc] instead.
//! This crate is still available for earlier versions of Rust.**
//!
//! `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.
//!
//! See the associated [blog post] for the background behind this crate.
//!
//! [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/2497-if-let-chains.md
//! [blog post]: https://lambda.xyz/blog/if-chain
//!
//! # Note about recursion limits
Expand Down