Skip to content

Instantly share code, notes, and snippets.

@leopard627
Last active January 18, 2019 15:16
Show Gist options
  • Save leopard627/ea5301e859311f7a6246b7240e0a8bfd to your computer and use it in GitHub Desktop.
Save leopard627/ea5301e859311f7a6246b7240e0a8bfd to your computer and use it in GitHub Desktop.
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