diff --git a/src/error-handling/converting-error-types.md b/src/error-handling/converting-error-types.md index 2605b991..03e5ba07 100644 --- a/src/error-handling/converting-error-types.md +++ b/src/error-handling/converting-error-types.md @@ -49,3 +49,12 @@ fn main() { println!("username or error: {username:?}"); } ``` + +
+ +Key points: + +* The `username` variable can be either `Ok(string)` or `Err(error)`. +* Use the `fs::write` call to test out the different scenarios: no file, empty file, file with username. + +
diff --git a/src/error-handling/try-operator.md b/src/error-handling/try-operator.md index 82e58254..02ad6d15 100644 --- a/src/error-handling/try-operator.md +++ b/src/error-handling/try-operator.md @@ -44,3 +44,12 @@ fn main() { println!("username or error: {username:?}"); } ``` + +
+ +Key points: + +* The `username` variable can be either `Ok(string)` or `Err(error)`. +* Use the `fs::write` call to test out the different scenarios: no file, empty file, file with username. + +