diff --git a/src/webm_stream.rs b/src/webm_stream.rs index 55d8e6e..b9124a1 100644 --- a/src/webm_stream.rs +++ b/src/webm_stream.rs @@ -26,13 +26,13 @@ impl, S: Stream> WebmBuffer { } } - pub fn poll_event<'a>(&'a mut self) -> Result>>, ParsingError> { + pub fn poll_event<'a, T: FromEbml<'a>>(&'a mut self) -> Result>, ParsingError> { // release buffer from previous event self.buffer.advance(self.last_read); self.last_read = 0; loop { - match WebmElement::check_space(&self.buffer) { + match T::check_space(&self.buffer) { Err(err) => { return Err(ParsingError::EbmlError(err)) }, @@ -40,7 +40,7 @@ impl, S: Stream> WebmBuffer { // need to refill buffer, below }, Ok(Some(_)) => { - return match WebmElement::decode_element(&self.buffer) { + return match T::decode_element(&self.buffer) { Err(err) => { Err(ParsingError::EbmlError(err)) },