Removed C style flow control

This commit is contained in:
2026-06-10 04:35:11 +02:00
parent 286894c5db
commit afd3d05e2f
10 changed files with 42 additions and 111 deletions
+3 -3
View File
@@ -99,17 +99,17 @@ pub fn test_block_expr() {
}
pub fn test_if_expr() {
let x = if (true) { 1 } else { 2 };
let x = if true { 1 } else { 2 };
assert_eq!(x, 1);
let y = if (false) { 1 } else { 2 };
let y = if false { 1 } else { 2 };
assert_eq!(y, 2);
}
pub fn test_range_expr() {
let r = 0..5;
let mut count = 0;
for (i : r) {
for i in r {
count++;
}
assert_eq!(count, 5);