+4
-4
@@ -127,9 +127,9 @@ public readonly partial struct Result : IEquatable<Result>
|
||||
[Pure] public override bool Equals(object? obj) => obj is Result other && Equals(other);
|
||||
[Pure] public bool Equals(Result other)
|
||||
{
|
||||
if (State == ResultState.Bottom)
|
||||
if (State == ResultState.Bottom || other.State == ResultState.Bottom)
|
||||
throw new ResultNotInitializedException();
|
||||
|
||||
|
||||
return Error == other.Error;
|
||||
}
|
||||
[Pure] public static bool operator ==(Result left, Result right) => left.Equals(right);
|
||||
@@ -260,9 +260,9 @@ public readonly struct Result<T> : IEquatable<Result<T>>
|
||||
[Pure] public override bool Equals(object? obj) => obj is Result<T> other && Equals(other);
|
||||
[Pure] public bool Equals(Result<T> other)
|
||||
{
|
||||
if (State == ResultState.Bottom)
|
||||
if (State == ResultState.Bottom || other.State == ResultState.Bottom)
|
||||
throw new ResultNotInitializedException();
|
||||
|
||||
|
||||
if (IsSuccess != other.IsSuccess)
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user