From 540fdce02aefcb0dae5735c55daec690c4571b18 Mon Sep 17 00:00:00 2001
From: timofey <tim@ongoteam.yaconnect.com>
Date: Fri, 30 Jun 2023 23:14:58 +0000
Subject: [PATCH] simplify `NullableFactory::deserialize`

---
 src/rstd/nullable.rs | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/rstd/nullable.rs b/src/rstd/nullable.rs
index bd9597e..49835c8 100644
--- a/src/rstd/nullable.rs
+++ b/src/rstd/nullable.rs
@@ -56,13 +56,7 @@ impl<'a, Ctx: Context<'a>, F: Factory<'a, Ctx>> Factory<'a, Ctx> for NullableFac
     type ParseError = PointParseError;
 
     fn deserialize(&self, inctx: impl InCtx<'a, Ctx>) -> ParseResult<'a, Ctx, Self> {
-        let factory = self.factory.clone();
-        let (address, inctx) = inctx.icnext_address(|slice| PointParseError::from(slice))?;
-        Ok(if address.point == HASH_ZEROS {
-            Nullable::Null(factory)
-        } else {
-            Nullable::NotNull(Point::from_address(address, factory, inctx.iresolver()))
-        })
+        self.ideserialize(inctx).seal()
     }
 
     fn extend(&self, _mentionable: Self::Mtbl, tail: &[u8]) -> ParseResult<'a, Ctx, Self> {