Move factory methods to Result.kt
This commit is contained in:
parent
b1ac605d05
commit
c9a7d16562
@ -1,4 +0,0 @@
|
|||||||
package com.mikebull94.result
|
|
||||||
|
|
||||||
fun <V> ok(value: V) = Ok<V, Nothing>(value)
|
|
||||||
fun <E> error(error: E) = Error<Nothing, E>(error)
|
|
@ -6,6 +6,9 @@ package com.mikebull94.result
|
|||||||
*/
|
*/
|
||||||
sealed class Result<out V, out E>
|
sealed class Result<out V, out E>
|
||||||
|
|
||||||
|
fun <V> ok(value: V) = Ok<V, Nothing>(value)
|
||||||
|
fun <E> error(error: E) = Error<Nothing, E>(error)
|
||||||
|
|
||||||
class Ok<out V, out E> internal constructor(val value: V) : Result<V, E>() {
|
class Ok<out V, out E> internal constructor(val value: V) : Result<V, E>() {
|
||||||
override fun equals(other: Any?): Boolean {
|
override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
|
Loading…
Reference in New Issue
Block a user