diff options
| author | Abdou Seck <djily02016@gmail.com> | 2019-12-16 08:34:30 -0500 |
|---|---|---|
| committer | Abdou Seck <djily02016@gmail.com> | 2019-12-16 09:12:13 -0500 |
| commit | 0c85dc1193978b5165491b99cc4922caf8d14a65 (patch) | |
| tree | 52dfb7d89525b540ce896e4eacd525fdfa8adef5 /info.toml | |
| parent | fe10e06c3733ddb4a21e90d09bf79bfe618e97ce (diff) | |
feat: Add type conversion and parsing exercises
Diffstat (limited to 'info.toml')
| -rw-r--r-- | info.toml | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -610,3 +610,43 @@ answers and don't understand why they work and yours doesn't. If you've learned from the sample solutions, I encourage you to come back to this exercise and try it again in a few days to reinforce what you've learned :)""" + +# TYPE CONVERSIONS + +[[exercises]] +name = "using_as" +path = "exercises/conversions/using_as.rs" +mode = "compile" +hint = """ +Use the `as` operator to cast one of the operands in the last line of the +`average` function into the expected return type.""" + +[[exercises]] +name = "from_into" +path = "exercises/conversions/from_into.rs" +mode = "test" +hint = """ +Follow the steps provided right before the `From` implementation""" + +[[exercises]] +name = "try_from_into" +path = "exercises/conversions/try_from_into.rs" +mode = "test" +hint = """ +Follow the steps provided right before the `From` implementation. +You can also use the example at https://doc.rust-lang.org/std/convert/trait.TryFrom.html""" + +[[exercises]] +name = "as_ref_mut" +path = "exercises/conversions/as_ref_mut.rs" +mode = "test" +hint = """ +Add AsRef<str> as a trait bound to the functions.""" + +[[exercises]] +name = "from_str" +path = "exercises/conversions/from_str.rs" +mode = "test" +hint = """ +If you've already solved try_from_into.rs, then this is almost a copy-paste. +Otherwise, go ahead and solve try_from_into.rs first."""
\ No newline at end of file |
