Why is there Myenum twise?

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;
}

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.