Remove EbmlEventSource trait in favor of concrete EbmlStreamingParser

This commit is contained in:
Tangent 2019-10-21 01:20:14 -04:00
parent fa85939c0b
commit eda2e4f7be
3 changed files with 13 additions and 26 deletions

View file

@ -1,7 +1,7 @@
use bytes::{Buf, BufMut, Bytes, BytesMut};
use futures::{stream::Stream, Async};
use crate::ebml::{EbmlEventSource, FromEbml};
use crate::ebml::FromEbml;
use crate::error::WebmetroError;
pub struct EbmlStreamingParser<S> {
@ -76,16 +76,6 @@ impl<I: Buf, S: Stream<Item = I, Error = WebmetroError>> EbmlStreamingParser<S>
}
}
impl<I: Buf, S: Stream<Item = I, Error = WebmetroError>> EbmlEventSource
for EbmlStreamingParser<S>
{
type Error = WebmetroError;
fn poll_event<'a, T: FromEbml<'a>>(&'a mut self) -> Result<Async<Option<T>>, WebmetroError> {
return EbmlStreamingParser::poll_event(self);
}
}
#[cfg(test)]
mod tests {
use bytes::IntoBuf;