Guest User

Untitled

a guest
Dec 13th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #[derive(Debug)]
  2. enum ResType {
  3. Num(u32),
  4. Cc(char),
  5. }
  6.  
  7. fn myfun(test: bool) -> ResType {
  8. if test {
  9. ResType::Num(0)
  10. } else {
  11. ResType::Cc('a')
  12. }
  13. }
  14.  
  15. fn main() {
  16. println!("{:?} {:?}", myfun(true), myfun(false));
  17. }
Add Comment
Please, Sign In to add comment