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

Method execute

behavioral/command/command/paste.rs:12–21  ·  view source on GitHub ↗
(&mut self, app: &mut Cursive)

Source from the content-addressed store, hash-verified

10
11impl Command for PasteCommand {
12 fn execute(&mut self, app: &mut Cursive) -> bool {
13 let mut editor = app.find_name::<EditView>("Editor").unwrap();
14
15 app.with_user_data(|context: &mut AppContext| {
16 self.backup = editor.get_content().to_string();
17 editor.set_content(context.clipboard.clone());
18 });
19
20 true
21 }
22
23 fn undo(&mut self, app: &mut Cursive) {
24 let mut editor = app.find_name::<EditView>("Editor").unwrap();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected