Fix some typo
This commit is contained in:
parent
37ac77d26d
commit
f9c05ed21e
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue