Skip to content

Commit

Permalink
Revert Optional<T> changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shibayan committed Nov 16, 2024
1 parent e1d59b8 commit 436889e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Sharprompt/Internal/Optional.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
namespace Sharprompt.Internal;

internal readonly struct Optional<T>(T value)
internal readonly struct Optional<T>
{
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<T> Empty = new();

Expand Down

0 comments on commit 436889e

Please sign in to comment.