for example ,
enum People {
Bad,
Good,
}
I would like to initialize a variable with enum type,
I would then have if statement that assign enum value to variable,
And I would like to use variable like:
fn main(){
People he;
if sth {
he = People::Good;
}else{
he = People::Bad;
}
dosth(&he);
}
I looked at the docs but cant figure out how to.
ifcan return a value, sohe = if ...is valid code.