Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[derive(Debug)]
- enum ResType {
- Num(u32),
- Cc(char),
- }
- fn myfun(test: bool) -> ResType {
- if test {
- ResType::Num(0)
- } else {
- ResType::Cc('a')
- }
- }
- fn main() {
- println!("{:?} {:?}", myfun(true), myfun(false));
- }
Add Comment
Please, Sign In to add comment