results: fix non-void [] overload
This commit is contained in:
parent
df7f2e7ed5
commit
8065e36c5a
|
@ -46,7 +46,7 @@ proc readHexChar*(c: char): byte {.noSideEffect, inline.}=
|
|||
of 'a'..'f': result = byte(ord(c) - ord('a') + 10)
|
||||
of 'A'..'F': result = byte(ord(c) - ord('A') + 10)
|
||||
else:
|
||||
raise newException(ValueError, $c & "is not a hexademical character")
|
||||
raise newException(ValueError, $c & " is not a hexademical character")
|
||||
|
||||
template skip0xPrefix(hexStr: string): int =
|
||||
## Returns the index of the first meaningful char in `hexStr` by skipping
|
||||
|
|
|
@ -453,7 +453,7 @@ func get*[T, E](self: var Result[T, E]): var T {.inline.} =
|
|||
assertOk(self)
|
||||
self.v
|
||||
|
||||
template `[]`*[T, E](self: Result[T, E]): T =
|
||||
template `[]`*[T: not void, E](self: Result[T, E]): T =
|
||||
## Fetch value of result if set, or raise Defect
|
||||
## Exception bridge mode: raise given Exception instead
|
||||
mixin get
|
||||
|
|
Loading…
Reference in New Issue