// Now we can repeat the demo from the previous part - but this time, our `CallbacksMut` type
// can be cloned.
Now we can repeat the demo from the previous part - but this time, our `CallbacksMut` type
can be cloned.
Now we can repeat the demo from the previous part - but this time our ` CallbacksMut ` type can be cloned .
fn demo_mut(c: &mut CallbacksMut) {
    c.register(|val| println!("Callback 1: {}", val));
    c.call(0);
    {
        let mut count: usize = 0;
        c.register(move |val| {
            count = count+1;
            println!("Callback 2: {} ({}. time)", val, count);
        } );
    }
    c.call(1); c.clone().call(2);
}
fn demo_mut ( c : & mut CallbacksMut ) { c . register ( | val | println ! ( " " val ) ) ; c . call ( 0 ) ; { let mut count : usize = 0 ; c . register ( move | val | { count = count + 1 ; println ! ( " " val count ) ; } ) ; } c . call ( 1 ) ; c . clone ( ) . call ( 2 ) ; }
Now we can repeat the demo from the previous part - but this time, our `CallbacksMut` type
can be cloned.
Now we can repeat the demo from the previous part - but this time our ` CallbacksMut ` type can be cloned .
c
&mut CallbacksMut