From b0077e07563ed9781da1e6edb947a7ee4766cadd Mon Sep 17 00:00:00 2001 From: timofey Date: Fri, 30 Jun 2023 23:12:56 +0000 Subject: [PATCH] simplify `TreeFactory::deserialize` --- src/rstd/collections/tree.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/rstd/collections/tree.rs b/src/rstd/collections/tree.rs index 2954276..da54f7c 100644 --- a/src/rstd/collections/tree.rs +++ b/src/rstd/collections/tree.rs @@ -159,11 +159,7 @@ impl<'a, Ctx: Context<'a>, F: Factory<'a, Ctx>> Factory<'a, Ctx> for TreeFactory type ParseError = TreeParseError; fn deserialize(&self, inctx: impl InCtx<'a, Ctx>) -> ParseResult<'a, Ctx, Self> { - let (node, inctx) = self.0.ideserialize(inctx)?; - let height = u64::a_deserialize(inctx)?; - let tree = Tree { node, height }; - tree.validate_height()?; - Ok(tree) + self.ideserialize(inctx).seal() } fn extend(&self, mut mentionable: Self::Mtbl, tail: &[u8]) -> ParseResult<'a, Ctx, Self> {