编辑代码

fn grreet_hello(language: &str) -> &'static str {
    let southern_germany = "Grüß Gott!";
    let mut chinese = "世界,你好";
    let english = "World, hello";
    let regions = [southern_germany,chinese,english];
    chinese = "吃了吗";
    for region in regions.iter() {
        println!("{}", &region)
    }
    // let a :i32 = 30_i32;
    // let b = 31_i32;
    if language == "zh" {
        chinese
    } else {
        english
    }
}

fn deconstruct() {
    let (a, mut b ) :(bool, bool) = (true, false);
    println!("{:?}, {:?}", a, b);
    b = true;
    assert_eq!(a, b);
}

struct Struct {
    e: i32
} 

// fn deconstruct2() {
//     let (a, b, c, d, e);
//     (a, b) = (1,2);
//     // [c,.., d] = [1,2,3,4,5,6,7];
//     [c, .., d, _] = [1, 2, 3, 4, 5];
//     Struct {e, ..} = Struct{e:456};
//     // println!("{}", (a,b,c,d,e));
// }

fn main() {
     println!("{}", grreet_hello("zh"));
     deconstruct();
    //  deconstruct2();
}