diff options
| author | Ben Striegel <ben.striegel@gmail.com> | 2013-03-04 22:36:15 -0500 |
|---|---|---|
| committer | Ben Striegel <ben.striegel@gmail.com> | 2013-03-04 22:36:15 -0500 |
| commit | 9db61e0c219f25fbccf5d284580a61e8806ca596 (patch) | |
| tree | 1336da4335c29776ef907df040931f755044ea62 /src/libstd | |
| parent | dd34178b4b4c0dbd4d5e5fda44fbdd608b733b3a (diff) | |
| download | rust-9db61e0c219f25fbccf5d284580a61e8806ca596.tar.gz rust-9db61e0c219f25fbccf5d284580a61e8806ca596.zip | |
De-implicit-self libcore
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/comm.rs | 12 | ||||
| -rw-r--r-- | src/libstd/flatpipes.rs | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/libstd/comm.rs b/src/libstd/comm.rs index 02875739eba..14a37ecbf52 100644 --- a/src/libstd/comm.rs +++ b/src/libstd/comm.rs @@ -26,35 +26,35 @@ pub struct DuplexStream<T, U> { } impl<T:Owned,U:Owned> GenericChan<T> for DuplexStream<T, U> { - fn send(x: T) { + fn send(&self, x: T) { self.chan.send(x) } } impl<T:Owned,U:Owned> GenericSmartChan<T> for DuplexStream<T, U> { - fn try_send(x: T) -> bool { + fn try_send(&self, x: T) -> bool { self.chan.try_send(x) } } impl<T:Owned,U:Owned> GenericPort<U> for DuplexStream<T, U> { - fn recv() -> U { + fn recv(&self) -> U { self.port.recv() } - fn try_recv() -> Option<U> { + fn try_recv(&self) -> Option<U> { self.port.try_recv() } } impl<T:Owned,U:Owned> Peekable<U> for DuplexStream<T, U> { - pure fn peek() -> bool { + pure fn peek(&self) -> bool { self.port.peek() } } impl<T:Owned,U:Owned> Selectable for DuplexStream<T, U> { - pure fn header() -> *pipes::PacketHeader { + pure fn header(&self) -> *pipes::PacketHeader { self.port.header() } } diff --git a/src/libstd/flatpipes.rs b/src/libstd/flatpipes.rs index 42f954f7c39..b89396436c5 100644 --- a/src/libstd/flatpipes.rs +++ b/src/libstd/flatpipes.rs @@ -259,13 +259,13 @@ pub trait ByteChan { const CONTINUE: [u8 * 4] = [0xAA, 0xBB, 0xCC, 0xDD]; impl<T,U:Unflattener<T>,P:BytePort> GenericPort<T> for FlatPort<T, U, P> { - fn recv() -> T { + fn recv(&self) -> T { match self.try_recv() { Some(val) => val, None => fail!(~"port is closed") } } - fn try_recv() -> Option<T> { + fn try_recv(&self) -> Option<T> { let command = match self.byte_port.try_recv(CONTINUE.len()) { Some(c) => c, None => { @@ -304,7 +304,7 @@ impl<T,U:Unflattener<T>,P:BytePort> GenericPort<T> for FlatPort<T, U, P> { } impl<T,F:Flattener<T>,C:ByteChan> GenericChan<T> for FlatChan<T, F, C> { - fn send(val: T) { + fn send(&self, val: T) { self.byte_chan.send(CONTINUE.to_vec()); let bytes = self.flattener.flatten(val); let len = bytes.len() as u64; |
