diff --git a/src/net.rs b/src/net.rs index 1fbc9b98a4..eb4ceca103 100644 --- a/src/net.rs +++ b/src/net.rs @@ -53,25 +53,12 @@ impl<'a, N: NetworkListener + 'a> Iterator for NetworkConnections<'a, N> { } } - /// An abstraction over streams that a Server can utilize. -pub trait NetworkStream: Read + Write + Any + StreamClone + Send + Typeable { +pub trait NetworkStream: Read + Write + Any + Send + Typeable { /// Get the remote address of the underlying connection. fn peer_addr(&mut self) -> io::Result; } -#[doc(hidden)] -pub trait StreamClone { - fn clone_box(&self) -> Box; -} - -impl StreamClone for T { - #[inline] - fn clone_box(&self) -> Box { - Box::new(self.clone()) - } -} - /// A connector creates a NetworkStream. pub trait NetworkConnector { /// Type of Stream to create @@ -92,11 +79,6 @@ impl fmt::Debug for Box { } } -impl Clone for Box { - #[inline] - fn clone(&self) -> Box { self.clone_box() } -} - impl NetworkStream + Send { unsafe fn downcast_ref_unchecked(&self) -> &T { mem::transmute(traitobject::data(self))