Skip to content

Commit d50d651

Browse files
committed
case warning
1 parent e498592 commit d50d651

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

struct.nim

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,12 @@ proc newStructBool*(b: bool): StructNode =
6666
result.kind = StructBool
6767
result.bval = b
6868

69-
proc newStructInt*[T: uint|int|int16|uint16|int32|uint32|int64|uint64|BiggestInt](i: T): StructNode =
70-
result.kind = StructInt
71-
result.num = i.BiggestInt
69+
proc newStructInt*[T: uint|int|int16|uint16|int32|uint32|int64|uint64|BiggestInt](i: T): StructNode =
70+
result = StructNode(kind: StructInt, num: i.BiggestInt)
7271
73-
proc newStructFloat*(d: BiggestFloat): StructNode =
74-
result.kind = StructFloat
75-
result.fval = d
72+
proc newStructFloat*(d: BiggestFloat): StructNode = StructNode(kind: StructFloat, fval: d)
7673
77-
proc newStructString*(s: string): StructNode =
78-
result.kind = StructString
79-
result.str = s
74+
proc newStructString*(s: string): StructNode = StructNode(kind: StructString, str: s)
8075
8176
proc newStructContext(): StructContext =
8277
result.byteOrder = system.cpuEndian

0 commit comments

Comments
 (0)