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

Method execute

behavioral/command/command/copy.rs:10–18  ·  view source on GitHub ↗
(&mut self, app: &mut Cursive)

Source from the content-addressed store, hash-verified

8
9impl Command for CopyCommand {
10 fn execute(&mut self, app: &mut Cursive) -> bool {
11 let editor = app.find_name::<EditView>("Editor").unwrap();
12 let mut context = app.take_user_data::<AppContext>().unwrap();
13
14 context.clipboard = editor.get_content().to_string();
15
16 app.set_user_data(context);
17 false
18 }
19
20 fn undo(&mut self, _: &mut Cursive) {}
21}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected