mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-21 00:00:10 +02:00
Use an events iterator rather than indexing (#82)
Eventually mio won't provide an indexable interface, so switch over to using the iterator-based interface for now.
This commit is contained in:
committed by
Carl Lerche
parent
555c97b313
commit
dac13c1df4
+2
-3
@@ -172,8 +172,7 @@ impl Reactor {
|
||||
}
|
||||
|
||||
// Process all the events that came in, dispatching appropriately
|
||||
for i in 0..self.events.len() {
|
||||
let event = self.events.get(i).unwrap();
|
||||
for event in self.events.iter() {
|
||||
let token = event.token();
|
||||
trace!("event {:?} {:?}", event.readiness(), event.token());
|
||||
|
||||
@@ -187,7 +186,7 @@ impl Reactor {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn dispatch(&mut self, token: mio::Token, ready: mio::Ready) {
|
||||
fn dispatch(&self, token: mio::Token, ready: mio::Ready) {
|
||||
let token = usize::from(token) - TOKEN_START;
|
||||
let io_dispatch = self.inner.io_dispatch.read().unwrap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user