mirror of
https://github.com/rust-lang/book.git
synced 2026-11-30 21:41:18 -06:00
Merge pull request #304 from florolf/fix-ch06-typos
fix some typos in chapter 6
This commit is contained in:
@@ -84,7 +84,7 @@ suggestions in a totally different direction! /Carol -->
|
|||||||
An `enum` definition is similar to a `struct` definition: it defines a new type
|
An `enum` definition is similar to a `struct` definition: it defines a new type
|
||||||
and a template of what instances of that new type will be like. When you want to
|
and a template of what instances of that new type will be like. When you want to
|
||||||
use a struct, you create an instance of the struct. When you want to use an
|
use a struct, you create an instance of the struct. When you want to use an
|
||||||
enum, you use an instannce of the enum that is one of the variants the enum
|
enum, you use an instance of the enum that is one of the variants the enum
|
||||||
allows.
|
allows.
|
||||||
|
|
||||||
<!-- Option 2: -->
|
<!-- Option 2: -->
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## The `Option` Enum and its Advantages Over Null Values
|
## The `Option` Enum and its Advantages Over Null Values
|
||||||
|
|
||||||
In the previous section, we looked at how the `IpAddr` enum let us use Rust's
|
In the previous section, we looked at how the `IpAddr` enum lets us use Rust's
|
||||||
type system to encode more information than just the data into our program.
|
type system to encode more information than just the data into our program.
|
||||||
This section is a case study of `Option`, which is another enum defined by the
|
This section is a case study of `Option`, which is another enum defined by the
|
||||||
standard library. The `Option` type is used in many places because it encodes
|
standard library. The `Option` type is used in many places because it encodes
|
||||||
|
|||||||
Reference in New Issue
Block a user