Skip to content

Commit

Permalink
add timeout to clipboard init
Browse files Browse the repository at this point in the history
  • Loading branch information
jonZlotnik committed Mar 7, 2023
1 parent 90529c1 commit 554bbf8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
**/*.rs.bk

.idea/
.vscode/
.vscode/
16 changes: 9 additions & 7 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ mod util;

use std::{
ops::Deref,
time::{Duration, Instant}, thread, sync::mpsc,
sync::mpsc,
thread,
time::{Duration, Instant},
};

use async_std::{fs::OpenOptions, sync::Arc};
Expand Down Expand Up @@ -288,11 +290,12 @@ async fn main() -> eyre::Result<()> {
let (sender, receiver) = mpsc::channel();
let _clipboard_init_thread = thread::spawn(move || {
match sender.send(
ClipboardContext::new().map_err(|err| {
log::warn!("Failed to initialize clipboard support: {}", err);
})
.ok()
){
ClipboardContext::new()
.map_err(|err| {
log::warn!("Failed to initialize clipboard support: {}", err);
})
.ok(),
) {
Ok(()) => {}, // everything good
Err(_) => {}, // we have been released, don't panic
}
Expand All @@ -307,7 +310,6 @@ async fn main() -> eyre::Result<()> {
None
},
};


let concat_file_name = |file_path: &Path, file_name: Option<_>| {
// TODO this has gotten out of hand (it ugly)
Expand Down

0 comments on commit 554bbf8

Please sign in to comment.