Created
August 19, 2020 04:06
-
-
Save zmarvel/e46471a5cacde2c36c628571cd5b35cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct A { | |
name: String | |
} | |
struct B { | |
name: String | |
} | |
struct C { | |
} | |
enum ABC { | |
A(A), | |
B(B), | |
C(C), | |
} | |
fn get_name(abc: ABC) -> String { | |
match abc { | |
C => String::from(""), | |
_ => abc.name | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment