File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ enum Option<T> {
17
17
```
18
18
19
19
The ` <T> ` part, which you’ve seen a few times before, indicates that this is
20
- a generic data type. Inside the declaration of our enum, wherever we see a ` T ` ,
20
+ a generic data type. Inside the declaration of our ` enum ` , wherever we see a ` T ` ,
21
21
we substitute that type for the same type used in the generic. Here’s an
22
22
example of using ` Option<T> ` , with some extra type annotations:
23
23
@@ -115,10 +115,10 @@ let int_origin = Point { x: 0, y: 0 };
115
115
let float_origin = Point { x : 0.0 , y : 0.0 };
116
116
```
117
117
118
- Similarly to functions, the ` <T> ` is where we declare the generic parameters,
118
+ Similar to functions, the ` <T> ` is where we declare the generic parameters,
119
119
and we then use ` x: T ` in the type declaration, too.
120
120
121
- When you want to add an implementation for the generic struct, you just
121
+ When you want to add an implementation for the generic ` struct ` , you just
122
122
declare the type parameter after the ` impl ` :
123
123
124
124
``` rust
You can’t perform that action at this time.
0 commit comments