fix: type mismatch in task extensions
All checks were successful
default / dotnet default workflow (8.0) (push) Successful in 1m10s

This commit is contained in:
Louis Seubert 2024-07-03 22:26:43 +02:00
parent 0ff9cfd8fb
commit b3ed128536
Signed by: louis9902
GPG key ID: 4B9DB28F826553BD

View file

@ -18,7 +18,7 @@ public static partial class Extensions
/// Maps the success value of the result object of the completed task using a mapping function, or does nothing if
/// the result object of the completed task is a failure.
/// </summary>
/// <param name="result">A task object retunring a result object when completing.</param>
/// <param name="result">A task object returning a result object when completing.</param>
/// <param name="func">The function used to map the success value.</param>
/// <typeparam name="T">The type of the object inside the result returned by the task.</typeparam>
/// <typeparam name="TNew">The type of the new value.</typeparam>
@ -26,7 +26,7 @@ public static partial class Extensions
/// result.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
// ReSharper disable once InconsistentNaming
public static async ValueTask<Result<TNew>> Map<T, TNew>(this Task<Result<T>> result,
public static async Task<Result<TNew>> Map<T, TNew>(this Task<Result<T>> result,
Func<T, TNew> func)
=> (await result).Map(func);
@ -40,7 +40,7 @@ public static partial class Extensions
/// Maps the success value of the result object of the completed task to a new result using a mapping function, or
/// does nothing if the result object of the completed task is a failure.
/// </summary>
/// <param name="result">A task object retunring a result object when completing.</param>
/// <param name="result">A task object returning a result object when completing.</param>
/// <param name="func">The function used to map the success value.</param>
/// <typeparam name="T">The type of the object inside the result returned by the task.</typeparam>
/// <typeparam name="TNew">The type of the new value.</typeparam>
@ -65,7 +65,7 @@ public static partial class Extensions
/// <inheritdoc cref="Map{T,TNew}(System.Threading.Tasks.Task{Geekeey.Extensions.Result.Result{T}},System.Func{T,TNew})"/>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
// ReSharper disable once InconsistentNaming
public static async Task<Result<TNew>> Map<T, TNew>(this ValueTask<Result<T>> result,
public static async ValueTask<Result<TNew>> Map<T, TNew>(this ValueTask<Result<T>> result,
Func<T, TNew> func)
=> (await result).Map(func);