X-Git-Url: https://git.ralfj.de/rust-101.git/blobdiff_plain/188b1ec1b8528e2326791feccc8077e15bd60182..7fdd4203f19f2fa9096d0a662acf22d447e57af1:/workspace/src/part12.rs?ds=inline diff --git a/workspace/src/part12.rs b/workspace/src/part12.rs index a351995..23db4f6 100644 --- a/workspace/src/part12.rs +++ b/workspace/src/part12.rs @@ -13,7 +13,7 @@ struct Callbacks { impl Callbacks { pub fn new() -> Self { - unimplemented!() + Callbacks { callbacks: Vec::new() } } // Registration works just like last time, except that we are creating an `Rc` now. @@ -69,11 +69,10 @@ struct CallbacksMut { impl CallbacksMut { pub fn new() -> Self { - unimplemented!() + CallbacksMut { callbacks: Vec::new() } } pub fn register(&mut self, callback: F) { - let cell = Rc::new(RefCell::new(callback)); unimplemented!() }