From a5a03d8f61a5b2c2111b21031a3f526ef60844dd Mon Sep 17 00:00:00 2001 From: josthoff Date: Tue, 9 Jul 2019 20:11:30 +0200 Subject: [PATCH] fixed inconsistent terminology regarding enums --- src/ch06-00-enums.md | 2 +- src/ch06-01-defining-an-enum.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ch06-00-enums.md b/src/ch06-00-enums.md index 767f8668da..cf7ea67f60 100644 --- a/src/ch06-00-enums.md +++ b/src/ch06-00-enums.md @@ -1,7 +1,7 @@ # Enums and Pattern Matching In this chapter we’ll look at *enumerations*, also referred to as *enums*. -Enums allow you to define a type by enumerating its possible values. First, +Enums allow you to define a type by enumerating its possible *variants*. First, we’ll define and use an enum to show how an enum can encode meaning along with data. Next, we’ll explore a particularly useful enum, called `Option`, which expresses that a value can be either something or nothing. Then we’ll look at diff --git a/src/ch06-01-defining-an-enum.md b/src/ch06-01-defining-an-enum.md index 9a56af7372..0d25afbb68 100644 --- a/src/ch06-01-defining-an-enum.md +++ b/src/ch06-01-defining-an-enum.md @@ -5,18 +5,18 @@ are useful and more appropriate than structs in this case. Say we need to work with IP addresses. Currently, two major standards are used for IP addresses: version four and version six. These are the only possibilities for an IP address that our program will come across: we can *enumerate* all possible -values, which is where enumeration gets its name. +variants, which is where enumeration gets its name. Any IP address can be either a version four or a version six address, but not both at the same time. That property of IP addresses makes the enum data -structure appropriate, because enum values can only be one of the variants. +structure appropriate, because enum values can only be one of its variants. Both version four and version six addresses are still fundamentally IP addresses, so they should be treated as the same type when the code is handling situations that apply to any kind of IP address. We can express this concept in code by defining an `IpAddrKind` enumeration and -listing the possible kinds an IP address can be, `V4` and `V6`. These are known -as the *variants* of the enum: +listing the possible kinds an IP address can be, `V4` and `V6`. These are the +variants of the enum: ```rust enum IpAddrKind {