Last active
January 18, 2019 15:16
-
-
Save leopard627/ea5301e859311f7a6246b7240e0a8bfd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
enum IpAddrKind { | |
V4(String), | |
V6(String) | |
} | |
enum IpAddrKindV2 { | |
V4(u8, u8, u8, u8), | |
V6(String) | |
} | |
#[test] | |
fn enum_test() { | |
let ip = IpAddrKind::V4(String::from("127.0.0.1")); | |
let ip_v2 = IpAddrKindV2::V4(127, 0, 0, 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment