Skip to content

Commit

Permalink
results: fix non-void [] overload
Browse files Browse the repository at this point in the history
  • Loading branch information
arnetheduck committed Apr 23, 2020
1 parent df7f2e7 commit 8065e36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stew/byteutils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stew/results.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8065e36

Please sign in to comment.