From 04300d84bd43714d7fdca1cb985d177914fb2a39 Mon Sep 17 00:00:00 2001 From: Caleb Cartwright Date: Tue, 29 Apr 2025 15:36:23 -0500 Subject: Also allow bool literals as first item of let chain Co-authored-by: est31 --- src/tools/rustfmt/tests/source/let_chains.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/tools/rustfmt/tests/source') diff --git a/src/tools/rustfmt/tests/source/let_chains.rs b/src/tools/rustfmt/tests/source/let_chains.rs index b7c1f811096..0c4d8aa85ea 100644 --- a/src/tools/rustfmt/tests/source/let_chains.rs +++ b/src/tools/rustfmt/tests/source/let_chains.rs @@ -20,6 +20,11 @@ fn test_single_line_let_chain() { if a && let Some(b) = foo() { } + // first item in let-chain is a bool literal + if true && let Some(x) = y { + + } + // first item in let-chain is a unary ! with an ident let unary_not = if !from_hir_call && let Some(p) = parent @@ -94,11 +99,6 @@ fn test_multi_line_let_chain() { } - // bool literal - if true && let Some(x) = y { - - } - // cast to a bool if 1 as bool && let Some(x) = y { -- cgit 1.4.1-3-g733a5