From 93d3b8aa6b681a8add60e4a22a5c41e7f7ce7557 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 7 Sep 2012 19:04:40 -0700 Subject: Convert class methods to impl methods. Stop parsing class methods --- src/libstd/comm.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/libstd') diff --git a/src/libstd/comm.rs b/src/libstd/comm.rs index d78e11452bc..3302b4955bb 100644 --- a/src/libstd/comm.rs +++ b/src/libstd/comm.rs @@ -13,10 +13,12 @@ use pipes::{Channel, Recv, Chan, Port, Selectable}; export DuplexStream; /// An extension of `pipes::stream` that allows both sending and receiving. -struct DuplexStream : Channel, Recv, Selectable { +struct DuplexStream { priv chan: Chan, priv port: Port , +} +impl DuplexStream : Channel { fn send(+x: T) { self.chan.send(x) } @@ -24,7 +26,9 @@ struct DuplexStream : Channel, Recv, Selectable { fn try_send(+x: T) -> bool { self.chan.try_send(x) } +} +impl DuplexStream : Recv { fn recv() -> U { self.port.recv() } @@ -36,7 +40,9 @@ struct DuplexStream : Channel, Recv, Selectable { pure fn peek() -> bool { self.port.peek() } +} +impl DuplexStream : Selectable { pure fn header() -> *pipes::PacketHeader { self.port.header() } -- cgit 1.4.1-3-g733a5