simpler TypelessFactory::deserialize

This commit is contained in:
AF 2023-06-30 19:03:52 +00:00
parent 19a55bf626
commit d668e023e3

View File

@ -91,10 +91,7 @@ impl<'a, Ctx: Context<'a>> Factory<'a, Ctx> for TypelessFactory<'a, Ctx> {
type ParseError = TypelessError<'a>;
fn deserialize(&self, dectx: &mut dyn DeCtx<'a, Ctx>) -> ParseResult<'a, Ctx, Self> {
match self.t_deserialize.de(dectx) {
Ok(mentionable) => Ok(mentionable),
Err(error) => Err(TypelessError(error)),
}
self.t_deserialize.de(dectx).map_err(TypelessError)
}
fn extend(&self, mentionable: Self::Mtbl, tail: &[u8]) -> ParseResult<'a, Ctx, Self> {