We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d48babe commit fb8ba51Copy full SHA for fb8ba51
compiler-core/src/format/tests/guards.rs
@@ -79,3 +79,29 @@ fn long_guard_with_alternative_patterns() {
79
"#
80
);
81
}
82
+
83
+#[test]
84
+fn guard_block_is_not_removed_even_if_redundant() {
85
+ assert_format!(
86
+ r#"pub fn main() {
87
+ case todo {
88
+ _ if { True && True } && True -> 1
89
+ _ -> 2
90
+ }
91
+}
92
+"#
93
+ );
94
95
96
97
+fn nested_guard_block_is_not_removed_even_if_redundant() {
98
99
100
101
+ _ if { True && { True && False } } && True -> 1
102
103
104
105
106
107
0 commit comments