X-Git-Url: https://git.ralfj.de/rust-101.git/blobdiff_plain/7c63fce3ed1474437f62a5f14cbd9fa398ec9abe..18e6fec08956d95a3fd1b4b1ef2a7bb9620c5fcf:/workspace/src/part11.rs?ds=inline diff --git a/workspace/src/part11.rs b/workspace/src/part11.rs index 01f170b..cc2a252 100644 --- a/workspace/src/part11.rs +++ b/workspace/src/part11.rs @@ -1,5 +1,5 @@ -// Rust-101, Part 11: Trait Objects, Box, Rc -// ========================================= +// Rust-101, Part 11: Trait Objects, Box, Rc, Lifetime bounds +// ========================================================== mod callbacks { // For now, we just decide that the callbacks have an argument of type `i32`. @@ -41,7 +41,10 @@ mod callbacks { c.call(0); let mut count: usize = 0; - c.register(Box::new(move |val| { count = count+1; println!("Callback 2, {}. time: {}", count, val); } )); + c.register(Box::new(move |val| { + count = count+1; + println!("Callback 2, {}. time: {}", count, val); + } )); c.call(1); c.call(2); } }