Skip to content

Commit 30badb7

Browse files
committed
fix: remove random tap methods I added for no reason
1 parent c0e6007 commit 30badb7

File tree

2 files changed

+1
-56
lines changed

2 files changed

+1
-56
lines changed

src/FluentUtils.Monad/OkResultType.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public sealed record OkResultType<T> : ResultType<T>
1414
internal OkResultType(T value, ILogger? logger = null)
1515
{
1616
Value = value;
17+
if (logger is not null) Logger = logger;
1718
}
1819

1920
internal T Value { get; }

src/FluentUtils.Monad/Operators/TapOperator.cs

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -123,60 +123,4 @@ public static async Task<ResultType<TIn>> Tap<TIn>(
123123
this Task<ResultType<TIn>> resultTask,
124124
Action<TIn> tap) =>
125125
(await resultTask).Tap(tap);
126-
127-
/// <summary>
128-
/// Tap into the value of a <see cref="ResultType{T}" /> to perform a
129-
/// side effect
130-
/// </summary>
131-
/// <remarks>
132-
/// The tap operator will only be executed if the input
133-
/// <see cref="ResultType{T}" /> is an <see cref="OkResultType{T}" />
134-
/// </remarks>
135-
/// <param name="resultTask">The <see cref="ResultType{T}" /></param>
136-
/// <param name="tap">The side effect</param>
137-
/// <typeparam name="TIn">The result value's type</typeparam>
138-
/// <returns>The original result</returns>
139-
[DebuggerStepperBoundary]
140-
public static async Task<ResultType<TIn>> Tap<TIn>(
141-
this Task<ResultType<Task<TIn>>> resultTask,
142-
Action<TIn> tap)
143-
{
144-
ResultType<Task<TIn>> result = await resultTask;
145-
return await result.Match(
146-
async valueTask =>
147-
{
148-
TIn value = await valueTask;
149-
tap(value);
150-
return await Result.OkAsync(value, result.Logger);
151-
},
152-
error => Result.ErrorAsync<TIn>(error, result.Logger));
153-
}
154-
155-
/// <summary>
156-
/// Tap into the value of a <see cref="ResultType{T}" /> to perform a
157-
/// side effect
158-
/// </summary>
159-
/// <remarks>
160-
/// The tap operator will only be executed if the input
161-
/// <see cref="ResultType{T}" /> is an <see cref="OkResultType{T}" />
162-
/// </remarks>
163-
/// <param name="resultTask">The <see cref="ResultType{T}" /></param>
164-
/// <param name="tap">The side effect</param>
165-
/// <typeparam name="TIn">The result value's type</typeparam>
166-
/// <returns>The original result</returns>
167-
[DebuggerStepperBoundary]
168-
public static async Task<ResultType<TIn>> Tap<TIn>(
169-
this Task<ResultType<Task<TIn>>> resultTask,
170-
Func<TIn, Task> tap)
171-
{
172-
ResultType<Task<TIn>> result = await resultTask;
173-
return await result.Match(
174-
async valueTask =>
175-
{
176-
TIn value = await valueTask;
177-
await tap(value);
178-
return await Result.OkAsync(value, result.Logger);
179-
},
180-
error => Result.ErrorAsync<TIn>(error, result.Logger));
181-
}
182126
}

0 commit comments

Comments
 (0)