enum Myenum{Name, Country,}
fn main(){
let Data:Myenum = Myenum::Country;
}
why is Myenum
in Data
with :
????
enum Myenum{Name, Country,}
fn main(){
let Data:Myenum = Myenum::Country;
}
why is Myenum
in Data
with :
????
The Myenum
before the =
is a type annotation. It can be used to say what the type of Data
should be. It is optional, so you can remove it:
fn main(){
let Data = Myenum::Country;
}