simplify TreeFactory::deserialize
This commit is contained in:
parent
d6c4ca11b5
commit
b0077e0756
@ -159,11 +159,7 @@ impl<'a, Ctx: Context<'a>, F: Factory<'a, Ctx>> Factory<'a, Ctx> for TreeFactory
|
||||
type ParseError = TreeParseError<F::ParseError>;
|
||||
|
||||
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> {
|
||||
|
Loading…
Reference in New Issue
Block a user