From 76be5e4e991160f5fd9093f03ee2ba260e8f7229 Mon Sep 17 00:00:00 2001 From: sjmann Date: Fri, 28 Feb 2020 00:09:08 +0000 Subject: feat: added new exercises for generics --- info.toml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'info.toml') diff --git a/info.toml b/info.toml index 178a6f4..8c8b1a5 100644 --- a/info.toml +++ b/info.toml @@ -608,6 +608,38 @@ Try mutating the incoming string vector. Vectors provide suitable methods for adding an element at the end. See the documentation at: https://doc.rust-lang.org/std/vec/struct.Vec.html""" +# Generics + +[[exercises]] +name = "generics1" +path = "exercises/generics/generics1.rs" +mode = "compile" +hint = """ +Vectors in rust make use of generics to create dynamically sized arrays of any type. +You need to tell the compiler what type we are pushing onto this vector.""" + +[[exercises]] +name = "generics2" +path = "exercises/generics/generics2.rs" +mode = "test" +hint = """ +Think carefully about what we need to do here. Currently we are wrapping only values of +type 'u32'. Maybe we need to update the explicit references to this data type somehow? +""" + +[[exercises]] +name = "generics3" +path = "exercises/generics/generics3_solution.rs" +mode = "test" +hint = """ +To find the best solution to this challenge you're going to need to think back to your +knowledge of traits, specifically Trait Bound Syntax - you may also need this: "use std::fmt::Display;" + +This is definitely harder than the last two exercises! You need to think about not only making the +ReportCard struct generic, but also the correct property - you will need to change the implementation +of the struct slightly too...you can do it! +""" + # THREADS [[exercises]] -- cgit v1.2.3 From 5b6e23c323a320ca8306c7645bead2132590624e Mon Sep 17 00:00:00 2001 From: sjmann Date: Fri, 28 Feb 2020 00:29:30 +0000 Subject: removed artifact from manual testing --- info.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'info.toml') diff --git a/info.toml b/info.toml index d0ed053..aff47ea 100644 --- a/info.toml +++ b/info.toml @@ -645,7 +645,7 @@ type 'u32'. Maybe we need to update the explicit references to this data type so [[exercises]] name = "generics3" -path = "exercises/generics/generics3_solution.rs" +path = "exercises/generics/generics3.rs" mode = "test" hint = """ To find the best solution to this challenge you're going to need to think back to your -- cgit v1.2.3