Rust and play

When Rust put a hobby, ha ha, look at records

 

 Error

Change it

 

 Cuo Cuocuo

 

 The third line comment cancel on the line

 

 This is wrong

 

 But re- let before use it on the line, because unused Well

fn main() {
    let x = (let y = 6);
}

Write is being given, because let no return.

 

 

 

 The first time I saw such wording. Line 3 does not use the words of x, will complain

 

 Line 13 semicolon ";" , then gg

let if usage

Use  for through the collection

fn main() {
    let a = [10, 20, 30, 40, 50];

    for element in a.iter() {
        println!("the value is: {}", element);
    }
}

 

 

 

Guess you like

Origin www.cnblogs.com/chenguifeng/p/11815713.html