X-Git-Url: https://git.ralfj.de/rust-101.git/blobdiff_plain/4b75a1808a0ee75383f81659f6262fefc7047a09..85f1f88dad52d7679bf5c1a5f5f6ab8d55252c33:/solutions/src/callbacks.rs?ds=inline diff --git a/solutions/src/callbacks.rs b/solutions/src/callbacks.rs index a42732d..2b0eeef 100644 --- a/solutions/src/callbacks.rs +++ b/solutions/src/callbacks.rs @@ -65,6 +65,7 @@ mod tests { // We do a clone, and call `call` on that one. This makes sure that it's not our `RefCell` that complains about two mutable borrows, // but rather the `RefCell` inside the `CallbacksMut`. let mut c2: Callbacks = c.borrow().clone(); + drop(c); c2.call(42); } } \ No newline at end of file