Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- }
Add Comment
Please, Sign In to add comment