diff options
Diffstat (limited to 'src/reader.rs')
-rw-r--r-- | src/reader.rs | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/src/reader.rs b/src/reader.rs index d2de170..074ab99 100644 --- a/src/reader.rs +++ b/src/reader.rs @@ -721,26 +721,10 @@ impl<R> Reader<R> { } } -impl<R: AsyncRead + Unpin> Stream for Reader<R> { - type Item = Result<Content>; - - fn poll_next( - self: std::pin::Pin<&mut Self>, - cx: &mut std::task::Context<'_>, - ) -> std::task::Poll<Option<Self::Item>> { - let mut e = self; - let mut pinned = pin!(e.read_content()); - pinned.as_mut().poll(cx).map(|result| Some(result)) - } -} - #[cfg(test)] pub(crate) mod test { - use futures::{sink::Buffer, StreamExt}; use tokio::io::AsyncRead; - use crate::element::Element; - use super::Reader; pub struct MockAsyncReader<'s> { @@ -855,25 +839,4 @@ pub(crate) mod test { let element = reader.read_element().await.unwrap(); println!("{:#?}", element); } - - #[tokio::test] - async fn test_element_stream() { - let mock = MockAsyncReader::new(TEST_DOC); - let mut reader = Reader::new(mock); - let element = reader.read_start_tag().await.unwrap(); - println!("start element: {:#?}", element); - let mut content_count = 0; - loop { - if let Some(content) = reader.next().await { - match content { - Ok(content) => { - content_count += 1; - println!("content {}: {:#?}", content_count, content) - } - Err(_) => break, - } - } - } - reader.read_end_tag().await.unwrap() - } } |