Simplify wake up of task

This commit is contained in:
Juan Aguilar Santillana 2020-12-12 20:12:50 +01:00
parent ae63eb8bb2
commit ca20322a94
2 changed files with 2 additions and 6 deletions

View File

@ -182,9 +182,7 @@ impl Inner {
self.len += data.len();
self.items.push_back(data);
self.need_read = self.len < MAX_BUFFER_SIZE;
if let Some(task) = self.task.take() {
task.wake()
}
self.task.wake();
}
#[cfg(test)]

View File

@ -725,9 +725,7 @@ impl Drop for Safety {
if Rc::strong_count(&self.payload) != self.level {
self.clean.set(true);
}
if let Some(task) = self.task.take() {
task.wake()
}
self.task.wake();
}
}