Post

Rust 1.89.0 will stabilize let-chains (yay 🎉). In the same release, clippy will flag `if` statements that can be collapsed further using a let-chain. Outcome: your CI will fail when 1.89.0 is released, and you can't fix it ahead of time because the feature clippy wants you to use isn't stable yet 🙃

An even better solution from @briansmith.bsky.social: you can set an MSRV *just for clippy* via clippy.toml. This will configure a variety of lints to behave as if you were using that version to run clippy, including the collapsible_if one. Back to fearless toolchain updates!

4 reposts13 likes

Also note that clippy will consume your crate MSRV and shut up about lints that do not conform to that MSRV. You don't need to configure clippy if you already have an MSRV