From 5e85d06df6700352360222d34994030202dbbcf1 Mon Sep 17 00:00:00 2001 From: timofey Date: Tue, 1 Aug 2023 20:17:04 +0000 Subject: [PATCH] `Nullable::is_null` --- src/rstd/nullable.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/rstd/nullable.rs b/src/rstd/nullable.rs index 3969a95..138a9e8 100644 --- a/src/rstd/nullable.rs +++ b/src/rstd/nullable.rs @@ -91,6 +91,13 @@ impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>> Nullable<'a, Ctx, A> { Nullable::NotNull(point) => Some(point), } } + + pub fn is_null(&self) -> bool { + match self { + Nullable::Null(_) => true, + Nullable::NotNull(_) => false, + } + } } impl NullableFactory {