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
The guide gives example code (below) that doesn't compile for this reason, but does not mention deriving anywhere, and I found this confusing.
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");}}
The text was updated successfully, but these errors were encountered:
The guide gives example code (below) that doesn't compile for this reason, but does not mention deriving anywhere, and I found this confusing.
The text was updated successfully, but these errors were encountered: