Fix some typo

This commit is contained in:
Ludovic Chenut 2023-10-10 15:02:24 +02:00
parent 37ac77d26d
commit f9c05ed21e
No known key found for this signature in database
GPG Key ID: D9A59B1907F1D50C
2 changed files with 3 additions and 3 deletions

View File

@ -43,12 +43,12 @@ proc readValue*[T](r: var BinaryReader, value: var T) =
value = fromBytes(type value, r.stream.read(length), bigEndian)
elif value is enum:
var asUInt: E
r.readValue(asUint)
r.readValue(asUInt)
#TODO raise instead
assert value.checkedEnumAssign(asUInt):
elif value is set:
var asUInt: E
r.readValue(asUint)
r.readValue(asUInt)
#TODO is this safe enough?
value = cast[type(value)](asUInt)
elif value is object:

View File

@ -76,7 +76,7 @@ proc writeValue*(w: var BinaryWriter, value: auto) =
w.stream.write w.workingByte
w.position = 0
w.workingByte = 0
elif value is seq | array | openarray:
elif value is seq | array | openArray:
for subV in value:
w.writeValue(subV)
else: