diff --git a/README.md b/README.md index cc6a0d9..7641715 100644 --- a/README.md +++ b/README.md @@ -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.88 or newer, check out [`if let` chains](https://blog.rust-lang.org/2025/06/26/Rust-1.88.0/#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. diff --git a/src/lib.rs b/src/lib.rs index 687935a..883b78a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,8 @@ //! This crate provides a single macro called `if_chain!`. //! +//! **If you're using Rust 1.88 or newer, check out [`if let` chains][rust] 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 @@ -7,6 +10,7 @@ //! //! See the associated [blog post] for the background behind this crate. //! +//! [rust]: https://blog.rust-lang.org/2025/06/26/Rust-1.88.0/#let-chains //! [blog post]: https://lambda.xyz/blog/if-chain //! //! # Note about recursion limits