@@ -83,9 +83,9 @@ that also implement `PartialEq`.
83
83
Deriving ` PartialOrd ` implements the ` partial_cmp ` method, which returns an
84
84
` Option<Ordering> ` that will be ` None ` when the values given don’t produce an
85
85
ordering. An example of a value that doesn’t produce an ordering, even though
86
- most values of that type can be compared, is the not-a-number ( ` NaN ` ) floating
87
- point value. Calling ` partial_cmp ` with any floating point number and the ` NaN `
88
- floating point value will return ` None ` .
86
+ most values of that type can be compared, is the ` NaN ` floating point value.
87
+ Calling ` partial_cmp ` with any floating point number and the ` NaN ` floating
88
+ point value will return ` None ` .
89
89
90
90
When derived on structs, ` PartialOrd ` compares two instances by comparing the
91
91
value in each field in the order in which the fields appear in the struct
@@ -111,9 +111,9 @@ a data structure that stores data based on the sort order of the values.
111
111
112
112
The ` Clone ` trait allows you to explicitly create a deep copy of a value, and
113
113
the duplication process might involve running arbitrary code and copying heap
114
- data. See the [ “Ways Variables and Data Interact:
115
- Clone”] [ ways- variables-and-data-interact- clone] <!-- ignore --> section in
116
- Chapter 4 for more information on ` Clone ` .
114
+ data. See [ Variables and Data Interacting with
115
+ Clone”] [ variables-and-data-interacting-with- clone ] <!-- ignore --> in Chapter 4
116
+ for more information on ` Clone ` .
117
117
118
118
Deriving ` Clone ` implements the ` clone ` method, which when implemented for the
119
119
whole type, calls ` clone ` on each of the parts of the type. This means all the
@@ -125,9 +125,9 @@ returned from `to_vec` will need to own its instances, so `to_vec` calls
125
125
` clone ` on each item. Thus, the type stored in the slice must implement ` Clone ` .
126
126
127
127
The ` Copy ` trait allows you to duplicate a value by only copying bits stored on
128
- the stack; no arbitrary code is necessary. See the [ “Stack-Only Data:
129
- Copy”] [ stack-only-data-copy ] <!-- ignore --> section in Chapter 4 for more
130
- information on ` Copy ` .
128
+ the stack; no arbitrary code is necessary. See [ “Stack-Only Data:
129
+ Copy”] [ stack-only-data-copy ] <!-- ignore --> in Chapter 4 for more information on
130
+ ` Copy ` .
131
131
132
132
The ` Copy ` trait doesn’t define any methods to prevent programmers from
133
133
overloading those methods and violating the assumption that no arbitrary code
@@ -166,11 +166,11 @@ meaning all fields or values in the type must also implement `Default` to
166
166
derive ` Default ` .
167
167
168
168
The ` Default::default ` function is commonly used in combination with the struct
169
- update syntax discussed in the [ “Creating Instances From Other Instances With
170
- Struct Update
171
- Syntax”] [ creating-instances-from-other-instances-with-struct-update-syntax ] <!-- ignore -->
172
- section in Chapter 5. You can customize a few fields of a struct and then
173
- set and use a default value for the rest of the fields by using
169
+ update syntax discussed in [ “Creating Instances From Other Instances With Struct
170
+ Update
171
+ Syntax”] [ creating-instances-from-other-instances-with-struct-update-syntax ] <!--
172
+ ignore --> in Chapter 5. You can customize a few fields of a struct and then set
173
+ and use a default value for the rest of the fields by using
174
174
` ..Default::default() ` .
175
175
176
176
The ` Default ` trait is required when you use the method ` unwrap_or_default ` on
@@ -180,5 +180,5 @@ The `Default` trait is required when you use the method `unwrap_or_default` on
180
180
181
181
[ creating-instances-from-other-instances-with-struct-update-syntax ] : ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-update-syntax
182
182
[ stack-only-data-copy ] : ch04-01-what-is-ownership.html#stack-only-data-copy
183
- [ ways- variables-and-data-interact- clone] : ch04-01-what-is-ownership.html#ways- variables-and-data-interact -clone
183
+ [ variables-and-data-interacting-with- clone ] : ch04-01-what-is-ownership.html#variables-and-data-interacting-with -clone
184
184
[ macros ] : ch20-05-macros.html#macros
0 commit comments