@@ -55,7 +55,7 @@ same type `T`.
55
55
Listing 10-5 shows the combined ` largest ` function definition using the generic
56
56
data type in its signature. The listing also shows how we can call the function
57
57
with either a slice of ` i32 ` values or ` char ` values. Note that this code won’t
58
- compile yet, but we’ll fix it later in this chapter .
58
+ compile yet.
59
59
60
60
<Listing number =" 10-5 " file-name =" src/main.rs " caption =" The `largest` function using generic type parameters; this doesn’t compile yet " >
61
61
@@ -77,10 +77,10 @@ states that the body of `largest` won’t work for all possible types that `T`
77
77
could be. Because we want to compare values of type ` T ` in the body, we can
78
78
only use types whose values can be ordered. To enable comparisons, the standard
79
79
library has the ` std::cmp::PartialOrd ` trait that you can implement on types
80
- (see Appendix C for more on this trait). By following the help text’s
81
- suggestion, we restrict the types valid for ` T ` to only those that implement
82
- ` PartialOrd ` and this example will compile, because the standard library
83
- implements ` PartialOrd ` on both ` i32 ` and ` char ` .
80
+ (see Appendix C for more on this trait). To fix the example code above, we would
81
+ need to follow the help text's suggestions and restrict the types valid for ` T `
82
+ to only those that implement ` PartialOrd ` . The example would then compile, because
83
+ the standard library implements ` PartialOrd ` on both ` i32 ` and ` char ` .
84
84
85
85
### In Struct Definitions
86
86
0 commit comments