simpler TypelessFactory::deserialize
This commit is contained in:
parent
19a55bf626
commit
d668e023e3
@ -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> {
|
||||
|
Loading…
Reference in New Issue
Block a user