add part03 solutions
[rust-101.git] / src / part02.rs
index a97c3673114ae1662cf7e744d422e735b7992a1e..2bf4d9705f2fb6db87fead0ce24e18dcffd2c6bf 100644 (file)
@@ -77,7 +77,7 @@ pub trait Minimum : Copy {
 //@ Next, we write `vec_min` as a generic function over a type `T` that we demand to satisfy the `Minimum` trait.
 //@ This requirement is called a *trait bound*.
 //@ The only difference to the version from the previous part is that we call `e.min(n)` instead
-//@ of `std::cmp::min(n, e)`. Rust automatically figures out that `n` is of type `T`, which implements
+//@ of `min_i32(n, e)`. Rust automatically figures out that `e` is of type `T`, which implements
 //@ the `Minimum` trait, and hence we can call that function.
 //@ 
 //@ There is a crucial difference to templates in C++: We actually have to declare which traits
@@ -148,7 +148,7 @@ pub fn main() {
 //@ If this printed `3`, then your generic `vec_min` is working! So get ready for the next part.
 
 // **Exercise 02.1**: Change your program such that it computes the minimum of a `Vec<f32>` (where
-// `f32` is the type // of 32-bit floating-point numbers). You should not change `vec_min` in any
+// `f32` is the type of 32-bit floating-point numbers). You should not change `vec_min` in any
 // way, obviously!
 
 //@ [index](main.html) | [previous](part01.html) | [raw source](workspace/src/part02.rs) |