work around some CastSizes warnings and fix unreachable code warnings (#5149)

This commit is contained in:
tersec 2023-06-30 19:34:04 +00:00 committed by GitHub
parent 0be95571a7
commit 583eb4db17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 16 deletions

View File

@ -650,7 +650,8 @@ proc readValue*(
raiseUnexpectedValue(reader, "Hex string of 4 bytes expected") raiseUnexpectedValue(reader, "Hex string of 4 bytes expected")
func `$`*(x: JustificationBits): string = func `$`*(x: JustificationBits): string =
"0x" & toHex(uint8(x)) # TODO, works around https://github.com/nim-lang/Nim/issues/22191
"0x" & toHex(uint64(uint8(x)))
proc readValue*(reader: var JsonReader, value: var JustificationBits) proc readValue*(reader: var JsonReader, value: var JustificationBits)
{.raises: [IOError, SerializationError, Defect].} = {.raises: [IOError, SerializationError, Defect].} =