actions 0.2.0

Software without side-effects. Redo and Undo. Macro's.
Documentation
mod helpers;
use crate::helpers::counter::*;

use actions::State;

#[test]
fn apply() {
    let mut c = Counter::default();
    assert_eq!(c.0, 0);

    c.apply(&CounterAction::Increment).unwrap();
    assert_eq!(c.0, 1);

    c.apply(&CounterAction::Decrement).unwrap();
    assert_eq!(c.0, 0);

    c.apply(&CounterAction::SetValue(10)).unwrap();
    assert_eq!(c.0, 10);
}