• Jordan Petridis's avatar
    EpisdoeWidget: Use take_mut crate to allow for a better api. · 3a9a2f40
    Jordan Petridis authored
    Currently it's required that you take mut self in order to manipulate
    the internal state machines. This would not allow passing an Arc/Rc to
    a callback since A/Rc<T> only derefs to &T and not T.
    The take_mut crate allows the retrieval of ownership if you have a &mut refference
    and as long you return T again. So Arc<Mutex<Machine> could work with
    callbacks and embed Nested state machies without copying.
Cargo.lock 98.2 KB