Sign in
android
/
toolchain
/
rustc
/
15a6560abe9880705f51d219c1fa94f880dbaf35
/
.
/
src
/
doc
/
book
/
listings
/
ch06-enums-and-pattern-matching
/
no-listing-03-variants-with-different-data
/
src
/
main.rs
blob: 844a14041c8ff1962168e305e06975b9d06f5290 [
file
] [
log
] [
blame
]
fn
main
()
{
// ANCHOR: here
enum
IpAddr
{
V4
(
u8
,
u8
,
u8
,
u8
),
V6
(
String
),
}
let
home
=
IpAddr
::
V4
(
127
,
0
,
0
,
1
);
let
loopback
=
IpAddr
::
V6
(
String
::
from
(
"::1"
));
// ANCHOR_END: here
}