Lifetime simplification reflecting probably-better understanding of them

This commit is contained in:
Tangent 128 2018-04-03 19:07:16 -04:00
parent 724eabf326
commit bebe593c30

View file

@ -218,11 +218,11 @@ pub struct Ebml<Source> {
pub source: Source pub source: Source
} }
pub trait FromEbml<'b>: Sized { pub trait FromEbml<'a>: Sized {
fn should_unwrap(element_id: u64) -> bool; fn should_unwrap(element_id: u64) -> bool;
fn decode(element_id: u64, bytes: &'b[u8]) -> Result<Self, Error>; fn decode(element_id: u64, bytes: &'a[u8]) -> Result<Self, Error>;
fn decode_element<'a: 'b>(bytes: &'a[u8]) -> Result<Option<(Self, usize)>, Error> { fn decode_element(bytes: &'a[u8]) -> Result<Option<(Self, usize)>, Error> {
match decode_tag(bytes) { match decode_tag(bytes) {
Ok(None) => Ok(None), Ok(None) => Ok(None),
Err(err) => Err(err), Err(err) => Err(err),