simplify TreeFactory::deserialize

This commit is contained in:
AF 2023-06-30 23:12:56 +00:00
parent d6c4ca11b5
commit b0077e0756

View File

@ -159,11 +159,7 @@ impl<'a, Ctx: Context<'a>, F: Factory<'a, Ctx>> Factory<'a, Ctx> for TreeFactory
type ParseError = TreeParseError<F::ParseError>; type ParseError = TreeParseError<F::ParseError>;
fn deserialize(&self, inctx: impl InCtx<'a, Ctx>) -> ParseResult<'a, Ctx, Self> { fn deserialize(&self, inctx: impl InCtx<'a, Ctx>) -> ParseResult<'a, Ctx, Self> {
let (node, inctx) = self.0.ideserialize(inctx)?; self.ideserialize(inctx).seal()
let height = u64::a_deserialize(inctx)?;
let tree = Tree { node, height };
tree.validate_height()?;
Ok(tree)
} }
fn extend(&self, mut mentionable: Self::Mtbl, tail: &[u8]) -> ParseResult<'a, Ctx, Self> { fn extend(&self, mut mentionable: Self::Mtbl, tail: &[u8]) -> ParseResult<'a, Ctx, Self> {