result type ok improved

This commit is contained in:
Oli Sturm
2026-05-10 14:35:47 +01:00
parent 73ed4c7b9c
commit 6e18e0195c
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -21,8 +21,11 @@ public static class ResultModule
{
public static T Ok<T>(T v) => v;
public static Result<T?, E> Ok<T, E>(T v)
=> new ResultOk<T?, E>(v);
public static Result<T?, E> OkNone<T, E>()
where T : class? => new ResultOk<T?, E>(null);
=> new ResultOk<T?, E>(default);
public static E Fail<E>(E e) => e;
}