Skip to content

Commit f015b60

Browse files
author
Adrián García
committed
Fix Task and resource toString
1 parent 4cfa4d3 commit f015b60

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mini-common/src/main/java/mini/Resource.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ open class Resource<out T> @PublishedApi internal constructor(val value: Any?) {
5454
}
5555

5656
override fun toString(): String {
57-
return value.toString()
57+
return if (isSuccess) "Success($value)" else value.toString()
5858
}
5959

6060
override fun equals(other: Any?): Boolean {
@@ -87,6 +87,7 @@ class Task(value: Any?) : Resource<Unit>(value) {
8787

8888
override fun toString(): String {
8989
return when {
90+
isSuccess -> "Success"
9091
isIdle -> "Idle"
9192
else -> value.toString()
9293
}

0 commit comments

Comments
 (0)