X-Git-Url: https://git.ralfj.de/rust-101.git/blobdiff_plain/7c63fce3ed1474437f62a5f14cbd9fa398ec9abe..0223210576f27d0743c2d12b890d30f5c2ef6b2d:/workspace/src/part11.rs 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); } }