You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enumOrdering{Less,Equal,Greater,}fncmp(a:int,b:int) -> Ordering{if a < b {Less}elseif a > b {Greater}else{Equal}}fnmain(){let x = 5i;let y = 10i;let ordering = cmp(x, y);if ordering == Less{println!("less");}elseif ordering == Greater{println!("greater");}elseif ordering == Equal{println!("equal");}}
This does not compile:
error: binary operation `==` cannot be applied to type `Ordering`