summaryrefslogtreecommitdiff
path: root/exercises/error_handling/errors5.rs
diff options
context:
space:
mode:
authortajo48 <55502906+tajo48@users.noreply.github.com>2023-06-15 00:46:45 +0200
committerGitHub <noreply@github.com>2023-06-15 00:46:45 +0200
commite1704a2f1bd2e1c92e0741d656228fe6ccf36a35 (patch)
tree6bbd1dd1ea127dd652e0fe64093c10a78734fdf5 /exercises/error_handling/errors5.rs
parent1e02f194fdd1cb1ca99cf1d93d11455db8b1bce6 (diff)
parent0282da6881c0708b5aaf6a01e731b88b61201f71 (diff)
Merge branch 'main' into main
Diffstat (limited to 'exercises/error_handling/errors5.rs')
-rw-r--r--exercises/error_handling/errors5.rs36
1 files changed, 21 insertions, 15 deletions
diff --git a/exercises/error_handling/errors5.rs b/exercises/error_handling/errors5.rs
index eb5506c..92461a7 100644
--- a/exercises/error_handling/errors5.rs
+++ b/exercises/error_handling/errors5.rs
@@ -1,20 +1,26 @@
// errors5.rs
-
+//
// This program uses an altered version of the code from errors4.
-
-// This exercise uses some concepts that we won't get to until later in the course, like `Box` and the
-// `From` trait. It's not important to understand them in detail right now, but you can read ahead if you like.
-// For now, think of the `Box<dyn ???>` type as an "I want anything that does ???" type, which, given
-// Rust's usual standards for runtime safety, should strike you as somewhat lenient!
-
-// In short, this particular use case for boxes is for when you want to own a value and you care only that it is a
-// type which implements a particular trait. To do so, The Box is declared as of type Box<dyn Trait> where Trait is the trait
-// the compiler looks for on any value used in that context. For this exercise, that context is the potential errors
-// which can be returned in a Result.
-
-// What can we use to describe both errors? In other words, is there a trait which both errors implement?
-
-// Execute `rustlings hint errors5` or use the `hint` watch subcommand for a hint.
+//
+// This exercise uses some concepts that we won't get to until later in the
+// course, like `Box` and the `From` trait. It's not important to understand
+// them in detail right now, but you can read ahead if you like. For now, think
+// of the `Box<dyn ???>` type as an "I want anything that does ???" type, which,
+// given Rust's usual standards for runtime safety, should strike you as
+// somewhat lenient!
+//
+// In short, this particular use case for boxes is for when you want to own a
+// value and you care only that it is a type which implements a particular
+// trait. To do so, The Box is declared as of type Box<dyn Trait> where Trait is
+// the trait the compiler looks for on any value used in that context. For this
+// exercise, that context is the potential errors which can be returned in a
+// Result.
+//
+// What can we use to describe both errors? In other words, is there a trait
+// which both errors implement?
+//
+// Execute `rustlings hint errors5` or use the `hint` watch subcommand for a
+// hint.
// I AM NOT DONE