results: fix non-void [] overload

This commit is contained in:
Jacek Sieka 2020-04-23 06:46:10 +02:00
parent df7f2e7ed5
commit 8065e36c5a
No known key found for this signature in database
GPG Key ID: A1B09461ABB656B8
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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