From 436889e552e180a828298a5acfc110127801b271 Mon Sep 17 00:00:00 2001 From: Tatsuro Shibamura Date: Sat, 16 Nov 2024 15:07:27 +0900 Subject: [PATCH] Revert Optional changes --- Sharprompt/Internal/Optional.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Sharprompt/Internal/Optional.cs b/Sharprompt/Internal/Optional.cs index ef23259..15367c8 100644 --- a/Sharprompt/Internal/Optional.cs +++ b/Sharprompt/Internal/Optional.cs @@ -1,10 +1,16 @@ namespace Sharprompt.Internal; -internal readonly struct Optional(T value) +internal readonly struct Optional { - public bool HasValue => true; + public Optional(T value) + { + HasValue = true; + Value = value; + } - public T Value { get; } = value; + public bool HasValue { get; } = false; + + public T Value { get; } = default!; public static readonly Optional Empty = new();