Skip to content

Commit

Permalink
Final touches for 0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
bartsokol committed May 22, 2018
1 parent 55cbf97 commit 1ce6978
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Monacs.Core/Result.Extensions.Async.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ public static async Task<TOut> MatchAsync<TIn, TOut>(this Task<Result<TIn>> resu
///</summary>
/// <typeparam name="T">Type of the encapsulated value.</typeparam>
/// <param name="result">The result of which the value should be ignored.</param>
public static async Task<Result<Monacs.Core.Unit.Unit>> IgnoreAsync<T>(this Task<Result<T>> result) =>
(await result).Map(_ => Monacs.Core.Unit.Unit.Default);
public static async Task<Result<Unit.Unit>> IgnoreAsync<T>(this Task<Result<T>> result) =>
(await result).Map(_ => Unit.Unit.Default);

/* Side Effects */

Expand Down
12 changes: 6 additions & 6 deletions Monacs.Core/Result.Extensions.Unit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ public static class UnitResult
///<summary>
/// Creates the Ok case instance of the <see cref="Result{Unit}" />.
///</summary>
public static Result<Unit> Ok() =>
Result.Ok(Unit.Default);
public static Result<Unit.Unit> Ok() =>
Result.Ok(Unit.Unit.Default);

///<summary>
/// Creates the Error case instance of the <see cref="Result{Unit}" /> type, containing error instead of value.
///</summary>
/// <param name="error">Details of the error.</param>
public static Result<Unit> Error(ErrorDetails error) =>
Result.Error<Unit>(error);
public static Result<Unit.Unit> Error(ErrorDetails error) =>
Result.Error<Unit.Unit>(error);

///<summary>
/// Rejects the value of the <see cref="Result{T}" /> and returns <see cref="Result{Unit}" /> instead.
/// If the input <see cref="Result{T}" /> is Error then the error details are preserved.
///</summary>
/// <typeparam name="T">Type of the encapsulated value.</typeparam>
/// <param name="result">The result of which the value should be ignored.</param>
public static Result<Unit> Ignore<T>(this Result<T> result) =>
result.Map(_ => Unit.Default);
public static Result<Unit.Unit> Ignore<T>(this Result<T> result) =>
result.Map(_ => Unit.Unit.Default);
}
}

0 comments on commit 1ce6978

Please sign in to comment.