MCPcopy Create free account
hub / github.com/fadeevab/design-patterns-rust / undo

Function undo

behavioral/command/main.rs:46–52  ·  view source on GitHub ↗

Pops the last command and executes an undo action.

(app: &mut Cursive)

Source from the content-addressed store, hash-verified

44
45/// Pops the last command and executes an undo action.
46fn undo(app: &mut Cursive) {
47 let mut context = app.take_user_data::<AppContext>().unwrap();
48 if let Some(mut command) = context.history.pop() {
49 command.undo(app)
50 }
51 app.set_user_data(context);
52}

Callers

nothing calls this directly

Calls 1

undoMethod · 0.45

Tested by

no test coverage detected