Skip to content

Commit

Permalink
added generic overload of Successful and Failed
Browse files Browse the repository at this point in the history
  • Loading branch information
md-redwan-hossain committed Sep 20, 2024
1 parent 4459128 commit a78ecfa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/SharpOutcome/Helpers/Failed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ namespace SharpOutcome.Helpers;
/// <summary>
/// Represents a generalized bad outcome.
/// </summary>
public readonly record struct Failed(string? Reason = null);
public readonly record struct Failed(string? Reason = null);

public readonly record struct Failed<TReason>(TReason? Reason = default);
3 changes: 2 additions & 1 deletion src/SharpOutcome/Helpers/Successful.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ namespace SharpOutcome.Helpers;
/// <summary>
/// Represents a generalized good outcome.
/// </summary>
public readonly record struct Successful(string? Reason = null);
public readonly record struct Successful(string? Reason = null);
public readonly record struct Successful<TReason>(TReason? Reason = default);

0 comments on commit a78ecfa

Please sign in to comment.