diff --git a/src/download.rs b/src/download.rs index 6a4aeb2..196545a 100644 --- a/src/download.rs +++ b/src/download.rs @@ -288,12 +288,19 @@ where if offset >= *this.available_file_size { trace!("waiting for inotify events"); file.get_or_insert(inner_file); - if ready!(this.events.poll_next(cx)).is_none() { - return Poll::Ready(Some(Err(ErrorInternalServerError( - "inotify stream empty", - )))); + match this.events.poll_next(cx) { + Poll::Pending => { + return Poll::Pending; + } + Poll::Ready(Some(_)) => { + return self.poll_next(cx); + } + _ => { + return Poll::Ready(Some(Err(ErrorInternalServerError( + "inotify stream empty", + )))); + } } - return self.poll_next(cx); } } diff --git a/src/file.rs b/src/file.rs new file mode 100644 index 0000000..e69de29