From e8cba590c92d99028d6f28907aa14fa02cfeece7 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Thu, 1 Sep 2016 10:12:46 -0400 Subject: [PATCH] Explain the type parameters a little since this is the first time --- src/ch09-02-recoverable-errors-with-result.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ch09-02-recoverable-errors-with-result.md b/src/ch09-02-recoverable-errors-with-result.md index bf8ec70be..52ba3d205 100644 --- a/src/ch09-02-recoverable-errors-with-result.md +++ b/src/ch09-02-recoverable-errors-with-result.md @@ -18,8 +18,12 @@ enum Result { 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: