This reverts commit 068412ff4e
.
This commit is contained in:
parent
068412ff4e
commit
b4b3841a85
|
@ -442,14 +442,11 @@ template capture*[E: Exception](T: type, someExceptionExpr: ref E): Result[T, re
|
||||||
ret = R.err(caught)
|
ret = R.err(caught)
|
||||||
ret
|
ret
|
||||||
|
|
||||||
func `==`*[T, E](lhs: Result[T, E], rhs: Result[T, E]): bool {.inline.} =
|
func `==`*[T0, E0, T1, E1](lhs: Result[T0, E0], rhs: Result[T1, E1]): bool {.inline.} =
|
||||||
if lhs.o != rhs.o:
|
if lhs.o != rhs.o:
|
||||||
false
|
false
|
||||||
elif lhs.o: # and rhs.o implied
|
elif lhs.o: # and rhs.o implied
|
||||||
when T is void:
|
lhs.v == rhs.v
|
||||||
true
|
|
||||||
else:
|
|
||||||
lhs.v == rhs.v
|
|
||||||
else:
|
else:
|
||||||
lhs.e == rhs.e
|
lhs.e == rhs.e
|
||||||
|
|
||||||
|
|
|
@ -275,8 +275,3 @@ func cstringF(s: string): CSRes =
|
||||||
doAssert false
|
doAssert false
|
||||||
|
|
||||||
discard cstringF("test")
|
discard cstringF("test")
|
||||||
|
|
||||||
# Compare void
|
|
||||||
block:
|
|
||||||
var a, b: Result[void, bool]
|
|
||||||
discard a == b
|
|
||||||
|
|
Loading…
Reference in New Issue