aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2023-07-20 23:23:29 -0400
committerJesse Luehrs <doy@tozt.net>2023-07-20 23:23:29 -0400
commit747a300b1b08a71820a46e67726fc3dc494127d7 (patch)
tree304c232f347c9ef29392efa4c5c322cca854c703 /src
parent106a58df29656a0da93aad5434d8850e4e2856ea (diff)
downloadrbw-747a300b1b08a71820a46e67726fc3dc494127d7.tar.gz
rbw-747a300b1b08a71820a46e67726fc3dc494127d7.zip
clippy
Diffstat (limited to 'src')
-rw-r--r--src/bin/rbw-agent/agent.rs26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/bin/rbw-agent/agent.rs b/src/bin/rbw-agent/agent.rs
index 54585a1..1345967 100644
--- a/src/bin/rbw-agent/agent.rs
+++ b/src/bin/rbw-agent/agent.rs
@@ -61,19 +61,25 @@ impl Agent {
}
let notifications_handler = crate::notifications::Handler::new();
let clipboard: Box<dyn copypasta::ClipboardProvider> =
- copypasta::ClipboardContext::new()
- .map(|v| {
- Box::new(v)
- as Box<dyn copypasta::ClipboardProvider + Send>
- })
- .unwrap_or_else(|e| {
+ copypasta::ClipboardContext::new().map_or_else(
+ |e| {
log::warn!("couldn't create clipboard context: {e}");
- Box::new(
- // infailible
+ let clipboard = Box::new(
+ // infallible
copypasta::nop_clipboard::NopClipboardContext::new()
.unwrap(),
- )
- });
+ );
+ let clipboard: Box<dyn copypasta::ClipboardProvider> =
+ clipboard;
+ clipboard
+ },
+ |clipboard| {
+ let clipboard = Box::new(clipboard);
+ let clipboard: Box<dyn copypasta::ClipboardProvider> =
+ clipboard;
+ clipboard
+ },
+ );
Ok(Self {
timer_r,
sync_timer_r,