diff --git a/binary_serialization/reader.nim b/binary_serialization/reader.nim index cc11e78..1720b64 100644 --- a/binary_serialization/reader.nim +++ b/binary_serialization/reader.nim @@ -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: diff --git a/binary_serialization/writer.nim b/binary_serialization/writer.nim index 619758d..0b39d05 100644 --- a/binary_serialization/writer.nim +++ b/binary_serialization/writer.nim @@ -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: