From 767afb847f07792893fcef221bd2763f408321d9 Mon Sep 17 00:00:00 2001 From: snkemp Date: Wed, 29 May 2024 21:53:37 -0400 Subject: [PATCH] Made structs in OneOf.Types readonly structs --- OneOf/Types/Assorted.cs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/OneOf/Types/Assorted.cs b/OneOf/Types/Assorted.cs index 3e4fd10..5ce66b1 100644 --- a/OneOf/Types/Assorted.cs +++ b/OneOf/Types/Assorted.cs @@ -3,27 +3,27 @@ namespace OneOf.Types { - public struct Yes { } - public struct No { } - public struct Maybe { } + public readonly struct Yes { } + public readonly struct No { } + public readonly struct Maybe { } - public struct Unknown { } - public struct True { } - public struct False { } + public readonly struct Unknown { } + public readonly struct True { } + public readonly struct False { } - public struct All { } - public struct Some { } + public readonly struct All { } + public readonly struct Some { } - public struct None + public readonly struct None { public static OneOf Of(T t) => new None(); } - public struct NotFound { } + public readonly struct NotFound { } - public struct Success { } + public readonly struct Success { } - public struct Success + public readonly struct Success { public Success(T value) { @@ -32,7 +32,7 @@ public Success(T value) public T Value { get; } } - public struct Result + public readonly struct Result { public Result(T value) { @@ -41,8 +41,8 @@ public Result(T value) public T Value { get; } } - public struct Error { } - public struct Error + public readonly struct Error { } + public readonly struct Error { public Error(T value) {