Codebase list ohcount / 85d5c3b4-c1f3-4d55-a24f-4c231b8d4c21/main test / src_dir / rust.rs
85d5c3b4-c1f3-4d55-a24f-4c231b8d4c21/main

Tree @85d5c3b4-c1f3-4d55-a24f-4c231b8d4c21/main (Download .tar.gz)

rust.rs @85d5c3b4-c1f3-4d55-a24f-4c231b8d4c21/mainraw · history · blame

/*
 * This is the example given by www.rust-lang.org
 */
// Line comments work too
fn main() {
    let nums = [1, 2];
    let noms = ["Tim", "Eston", "Aaron", "Ben"];
 
    let mut odds = nums.iter().map(|&x| x * 2 - 1);
 
    for num in odds {
        do spawn {
            println!("{:s} says hello from a lightweight thread!", noms[num]);
        }
    }
}