Skip to content

Commit 439ae3b

Browse files
committed
small tweaks
1 parent ad519e0 commit 439ae3b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Operations/Conversion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public Result<TValue> ToResult(Exception? error = null)
1818
=> _hasValue ? _value : Result.Error<TValue>(error);
1919

2020
[AsyncExtension]
21-
[OverloadResolutionPriority(1)]
21+
[OverloadResolutionPriority(1)] // so delegates returning subclasses of Exception also take this overload
2222
public Result<TValue> ToResult(Func<Exception> error)
2323
=> _hasValue ? _value : error();
2424
public Result<TValue> ToResult<TArg>(TArg arg, Func<TArg, Exception> error)

src/Operations/DisposeAsync.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace Ametrin.Optional;
44

55
public static class OptionDisposeAsyncExtensions
66
{
7-
public static ValueTask Dispose<TValue>(this Option<TValue> option) where TValue : IAsyncDisposable
7+
public static ValueTask DisposeAsync<TValue>(this Option<TValue> option) where TValue : IAsyncDisposable
88
{
99
return option._hasValue ? option._value.DisposeAsync() : ValueTask.CompletedTask;
1010
}

src/Operations/Or.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public TValue Or<TArg>(TArg arg, Func<Exception, TArg, TValue> factory)
4343

4444
[AsyncExtension]
4545
[StackTraceHidden]
46-
public TValue OrThrow() => OrThrow("Result is Error state");
46+
public TValue OrThrow() => OrThrow("Result is error state");
4747

4848
[AsyncExtension]
4949
[StackTraceHidden]
@@ -69,7 +69,7 @@ public TValue Or<TArg>(TArg arg, Func<TError, TArg, TValue> factory)
6969

7070
[AsyncExtension]
7171
[StackTraceHidden]
72-
public TValue OrThrow() => OrThrow("Result is Error state");
72+
public TValue OrThrow() => OrThrow("Result is error state");
7373

7474
[AsyncExtension]
7575
[StackTraceHidden]

0 commit comments

Comments
 (0)