Skip to content

Commit 39c3444

Browse files
authored
Merge pull request #4256 from km274/ch-10.1-minor-clarifications
Ch 10.1 minor clarifications
2 parents 6dd246c + 6c22ad7 commit 39c3444

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/ch10-01-syntax.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ same type `T`.
5555
Listing 10-5 shows the combined `largest` function definition using the generic
5656
data type in its signature. The listing also shows how we can call the function
5757
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.
5959

6060
<Listing number="10-5" file-name="src/main.rs" caption="The `largest` function using generic type parameters; this doesn’t compile yet">
6161

@@ -77,10 +77,10 @@ states that the body of `largest` won’t work for all possible types that `T`
7777
could be. Because we want to compare values of type `T` in the body, we can
7878
only use types whose values can be ordered. To enable comparisons, the standard
7979
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`.
8484

8585
### In Struct Definitions
8686

0 commit comments

Comments
 (0)