Skip to content

Commit a36095d

Browse files
committed
Rust: Add local data flow test with if expression
1 parent 977eb05 commit a36095d

File tree

1 file changed

+12
-0
lines changed
  • rust/ql/test/library-tests/dataflow/local

1 file changed

+12
-0
lines changed

rust/ql/test/library-tests/dataflow/local/main.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@ fn variable() {
33
println!("{:?} data flow!", s);
44
}
55

6+
fn if_expression(cond: bool) -> i64 {
7+
let a = 1;
8+
let b = 2;
9+
let c = if cond {
10+
a
11+
} else {
12+
b
13+
};
14+
c
15+
}
16+
617
fn main() {
718
variable();
19+
if_expression(true);
820
}

0 commit comments

Comments
 (0)