Files
codeql/rust/ql/test/library-tests/controlflow-unstable/test.rs
Tom Hvitved b6103e1ef4 Rust: Add CFG test for early return in async block
Also made the test comply with `cargo check`.
2024-11-19 10:32:43 +01:00

23 lines
452 B
Rust

// TODO: Move these tests into `controlflow` when they become stable features
mod if_expression {
fn test_and_if_let(a: bool, b: Option<bool>, c: bool) -> bool {
if a && let Some(d) = b {
d
} else {
false
}
}
fn test_and_if_let2(a: bool, b: i64, c: bool) -> bool {
if a && let d = b
&& c
{
d > 0
} else {
false
}
}
}