re-do deepaksirone's fix on the actual source file
[rust-101.git] / workspace / src / part11.rs
index ac19371db6d69594d87526d5e46d7267f4631de9..a93ad07ed684bb301ac3d14b501f68cfe7713b97 100644 (file)
@@ -23,7 +23,7 @@ impl Callbacks {
 
     // Registration simply stores the callback.
     pub fn register(&mut self, callback: Box<FnMut(i32)>) {
-        unimplemented!()
+        self.callbacks.push(callback);
     }
 
     // We can also write a generic version of `register`, such that it will be instantiated with some concrete closure type `F`
@@ -59,7 +59,7 @@ pub fn main() {
 }
 
 
-// **Exercise 11.1**: We made the arbitrary choice of using `i32` for the arguments. Generalize the data-structures above
+// **Exercise 11.1**: We made the arbitrary choice of using `i32` for the arguments. Generalize the data structures above
 // to work with an arbitrary type `T` that's passed to the callbacks. Since you need to call multiple callbacks with the
-// same `t: T`, you will either have to restrict `T` to `Copy` types, or pass a borrow.
+// same `t: T`, you will either have to restrict `T` to `Copy` types, or pass a reference.