Skip to content

Commit

Permalink
Nit 1
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkassimo committed Jan 14, 2019
1 parent beac39b commit ae51d18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ impl Resource {
let r = table.remove(&self.rid);
assert!(r.is_some());
// If TcpListener, we must kill all pending accepts!
if let Repr::TcpListener(l, m) = r.unwrap() {
// Drop first
std::mem::drop(l);
if let Repr::TcpListener(_, m) = r.unwrap() {
// Call notify on each task, so that they would error out
for (_, t) in m {
t.notify();
Expand Down
5 changes: 4 additions & 1 deletion src/tokio_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ impl Future for Accept {
r.track_task(self.task_id);
return Ok(futures::prelude::Async::NotReady);
}
Err(e) => return Err(From::from(e)),
Err(e) => {
r.untrack_task(self.task_id);
return Err(From::from(e));
}
},
AcceptState::Empty => panic!("poll Accept after it's done"),
};
Expand Down

0 comments on commit ae51d18

Please sign in to comment.