diff options
Diffstat (limited to 'src/libstd/comm')
| -rw-r--r-- | src/libstd/comm/mod.rs | 8 | ||||
| -rw-r--r-- | src/libstd/comm/select.rs | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/libstd/comm/mod.rs b/src/libstd/comm/mod.rs index 985a387ee2b..26d67daf7c1 100644 --- a/src/libstd/comm/mod.rs +++ b/src/libstd/comm/mod.rs @@ -305,7 +305,7 @@ pub struct Port<T> { /// An iterator over messages received on a port, this iterator will block /// whenever `next` is called, waiting for a new message, and `None` will be /// returned when the corresponding channel has hung up. -pub struct PortIterator<'a, T> { +pub struct Messages<'a, T> { priv port: &'a Port<T> } @@ -899,12 +899,12 @@ impl<T: Send> Port<T> { /// Returns an iterator which will block waiting for messages, but never /// `fail!`. It will return `None` when the channel has hung up. - pub fn iter<'a>(&'a self) -> PortIterator<'a, T> { - PortIterator { port: self } + pub fn iter<'a>(&'a self) -> Messages<'a, T> { + Messages { port: self } } } -impl<'a, T: Send> Iterator<T> for PortIterator<'a, T> { +impl<'a, T: Send> Iterator<T> for Messages<'a, T> { fn next(&mut self) -> Option<T> { self.port.recv_opt() } } diff --git a/src/libstd/comm/select.rs b/src/libstd/comm/select.rs index fa5ec1d3e30..6a10ac56a4e 100644 --- a/src/libstd/comm/select.rs +++ b/src/libstd/comm/select.rs @@ -94,7 +94,7 @@ pub struct Handle<'port, T> { priv port: &'port mut Port<T>, } -struct PacketIterator { priv cur: *mut Packet } +struct Packets { priv cur: *mut Packet } impl Select { /// Creates a new selection structure. This set is initially empty and @@ -267,7 +267,7 @@ impl Select { (*packet).selection_id = 0; } - fn iter(&self) -> PacketIterator { PacketIterator { cur: self.head } } + fn iter(&self) -> Packets { Packets { cur: self.head } } } impl<'port, T: Send> Handle<'port, T> { @@ -300,7 +300,7 @@ impl<'port, T: Send> Drop for Handle<'port, T> { } } -impl Iterator<*mut Packet> for PacketIterator { +impl Iterator<*mut Packet> for Packets { fn next(&mut self) -> Option<*mut Packet> { if self.cur.is_null() { None |
