From 1be0893d193eb2d8e451533058aead535c9cba2c Mon Sep 17 00:00:00 2001 From: Kyle Ratti Date: Fri, 3 May 2024 17:06:55 -0400 Subject: [PATCH] BREAKING CHANGE: feat: use record struct for Result --- Base/Structures/Result.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Base/Structures/Result.cs b/Base/Structures/Result.cs index 09f166a..ae05160 100644 --- a/Base/Structures/Result.cs +++ b/Base/Structures/Result.cs @@ -2,7 +2,7 @@ namespace FruityFoundation.Base.Structures; -public readonly struct Result +public readonly record struct Result { private readonly Maybe _successVal; private readonly Maybe _failureVal; @@ -49,5 +49,7 @@ public readonly struct Result } public T Merge(Func onSuccess, Func onFailure) => - IsSuccess ? onSuccess(_successVal.Value) : onFailure(_failureVal.Value); + IsSuccess + ? onSuccess(_successVal.Value) + : onFailure(_failureVal.Value); }