write part 16
[rust-101.git] / src / part07.rs
index 65449951eaf37a9fd17b188395296577545fa6a1..151a3d68ea91cac0bce206e8b979835473497e5f 100644 (file)
@@ -27,7 +27,7 @@ pub fn vec_min<T: Minimum>(v: &Vec<T>) -> Option<&T> {
 //@ Notice that the return type `Option<&T>` is technically (leaving the borrowing story aside) a
 //@ pointer to a `T`, that could optionally be invalid. In other words, it's just like a pointer in
 //@ C(++) or Java that can be `NULL`! However, thanks to `Option` being an `enum`, we cannot forget
-//@ to check the pointer for validity, avoiding the safety issues of C(++).<br/>
+//@ to check the pointer for validity, avoiding the safety issues of C(++). <br/>
 //@ Also, if you are worried about wasting space, notice that Rust knows that `&T` can never be
 //@ `NULL`, and hence optimizes `Option<&T>` to be no larger than `&T`. The `None` case is represented
 //@ as `NULL`. This is another great example of a zero-cost abstraction: `Option<&T>` is exactly like
@@ -35,7 +35,7 @@ pub fn vec_min<T: Minimum>(v: &Vec<T>) -> Option<&T> {
 
 // **Exercise 07.1**: For our `vec_min` to be usable with `BigInt`, you will have to provide an implementation of
 // `Minimum`. You should be able to pretty much copy the code you wrote for exercise 06.1. You should *not*
-// make any copies!
+// make any copies of `BigInt`!
 impl Minimum for BigInt {
     fn min<'a>(&'a self, other: &'a Self) -> &'a Self {
         unimplemented!()
@@ -147,4 +147,4 @@ fn test_vec_min() {
 // of course, need a `Display` bound on `T`.) Then you should be able to use them with `println!` just like you do
 // with numbers, and get rid of the inherent functions to print `SomethingOrNothing<i32>` and `SomethingOrNothing<f32>`.
 
-//@ [index](main.html) | [previous](part06.html) | [next](main.html)
+//@ [index](main.html) | [previous](part06.html) | [next](part08.html)