nandi/rustnimpublic Fork 0
99b837678a29fedd20bb68a5117a6621d8d178b4
Commits
Clone
git clone https://git.rickub.com/nandi/rustnim.git
git clone ssh://git@rickub.com/nandi/rustnim.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Add the differential test runner, and a lowering to measure with it 8ac32af · on 99b837678a29fedd20bb68a5117a6621d8d178b4 · nandithebull · 7h ago
012-match.rs · 16 lines · 243 BRust Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
fn name(n: u8) -> i32 {
    match n {
        0 => 100,
        1 | 2 => 200,
        3..=5 => 300,
        _ => 400,
    }
}

fn main() {
    let mut i: u8 = 0;
    while i < 8 {
        println!("{} {}", i, name(i));
        i += 1;
    }
}