Explain the type parameters a little since this is the first time

This commit is contained in:
Carol (Nichols || Goulding)
2016-09-14 13:58:40 -04:00
parent 6f581c30c2
commit e8cba590c9
@@ -18,8 +18,12 @@ enum Result<T, E> {
The `Ok` variant indicates a successful result, and `Err` indicates an
unsuccessful result. These two variants each contain one thing: in `Ok`'s case,
it's the successful return value. With `Err`, it's some type that represents
the error.
it's the successful return value. With `Err`, it's some value that represents
the error. The `T` and `E` are generic type parameters; we'll go into generics
in more detail in Chapter XX. What you need to know for right now is that the
`Result` type is defined such that it can have the same behavior for any type
`T` that is what we want to return in the success case, and any type `E` that
is what we want to return in the error case.
As an example, let's try opening a file: