@@ -14,7 +14,7 @@ use crate::{
Peer, Raft, RaftState, RemoteRaft, ReplicableCommand, Term,
};
-#[derive(Clone, Eq, PartialEq)]
+#[derive(Eq, PartialEq)]
enum Event {
NewTerm(Term, Index),
NewLogEntry(Index),
@@ -14,7 +14,7 @@
///
/// Note that the same reasoning does not apply to the `Receiver`. There are
/// more levels of mutability in the `Receiver`.
-#[derive(Clone, Debug)]
+#[derive(Debug)]
pub struct SharedSender<T>(std::sync::mpsc::Sender<T>);
unsafe impl<T> Sync for SharedSender<T> where T: Sync {}
@@ -48,3 +48,9 @@ impl<T> From<SharedSender<T>> for std::sync::mpsc::Sender<T> {
this.0
}
+
+impl<T> Clone for SharedSender<T> {
+ fn clone(&self) -> Self {
+ Self(self.0.clone())
+ }
+}