枚举(Enums)


enum Color {
    red, green, blue 
} 

fn main() {
    mut color := red  // TODO: color := Color.green  
    color = green  // TODO: color = .green 
    println(color) // ==> "1"  TODO: print "green"?  
}

results matching ""

    No results matching ""