summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOrhun Parmaksız <orhunparmaksiz@gmail.com>2022-09-29 23:10:38 +0200
committerOrhun Parmaksız <orhunparmaksiz@gmail.com>2022-09-29 23:10:38 +0200
commit327ca7c52b348870dd61e2181d7e50f3b5502790 (patch)
tree4ec431218766231bc3aeace97f6a7944569b4bef
parentce553d6200ebfc0f53605e7740432a95d710fc06 (diff)
refactor: Handle errors while setting the clipboard contents
-rw-r--r--src/app.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/app.rs b/src/app.rs
index 016160e..facd531 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -240,7 +240,9 @@ impl App {
*/
pub fn set_clipboard_contents(&mut self, contents: &str) {
if let Some(clipboard) = self.clipboard.as_mut() {
- clipboard.set_contents(contents.to_string()).unwrap();
+ if let Err(e) = clipboard.set_contents(contents.to_string()) {
+ eprintln!("{}", e);
+ }
}
}