examples/hello_world.rs
raw| 1 | use arboard::Clipboard; |
| 2 | |
| 3 | fn main() { |
| 4 | env_logger::init(); |
| 5 | let mut clipboard = Clipboard::new().unwrap(); |
| 6 | println!("Clipboard text was: {:?}", clipboard.get_text()); |
| 7 | |
| 8 | let the_string = "Hello, world!"; |
| 9 | clipboard.set_text(the_string).unwrap(); |
| 10 | println!("But now the clipboard text should be: \"{the_string}\""); |
| 11 | } |