summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mullvad-daemon/src/device.rs2
-rw-r--r--talpid-core/src/mpsc.rs6
2 files changed, 6 insertions, 2 deletions
diff --git a/mullvad-daemon/src/device.rs b/mullvad-daemon/src/device.rs
index c0dc1296fb..f4eba59d2d 100644
--- a/mullvad-daemon/src/device.rs
+++ b/mullvad-daemon/src/device.rs
@@ -1,4 +1,3 @@
-use crate::DaemonEventSender;
use chrono::{DateTime, Utc};
use futures::{
channel::{mpsc, oneshot},
@@ -18,7 +17,6 @@ use mullvad_types::{
use std::{
future::Future,
path::Path,
- sync::{Arc, Mutex},
time::{Duration, SystemTime},
};
use talpid_core::{
diff --git a/talpid-core/src/mpsc.rs b/talpid-core/src/mpsc.rs
index 050b90c81c..8c6424bc01 100644
--- a/talpid-core/src/mpsc.rs
+++ b/talpid-core/src/mpsc.rs
@@ -3,3 +3,9 @@ pub trait Sender<T> {
/// Sends an item over the underlying channel, failing only if the channel is closed.
fn send(&self, item: T) -> Result<(), ()>;
}
+
+impl<E> Sender<E> for futures::channel::mpsc::UnboundedSender<E> {
+ fn send(&self, content: E) -> Result<(), ()> {
+ self.unbounded_send(content).map_err(|_| ())
+ }
+}