Skip to content

Commit 1c18e11

Browse files
Make integral serialization nothrow
1 parent 1222b9f commit 1c18e11

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/google/protobuf/encoding.d

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ unittest
6161
assert((-1L).toProtobuf!(Wire.zigzag).array == [0x01]);
6262
}
6363

64+
nothrow unittest
65+
{
66+
cast(void)toProtobuf(byte(1));
67+
cast(void)toProtobuf(short(1));
68+
cast(void)toProtobuf(int(1));
69+
cast(void)toProtobuf(long(1));
70+
}
71+
6472
auto toProtobuf(T)(T value)
6573
if (isFloatingPoint!T)
6674
{

src/google/protobuf/internal.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ struct Varint
1010
private ubyte index;
1111
private ubyte _length;
1212

13-
this(long value)
13+
this(long value) nothrow
1414
out { assert(_length > 0); }
1515
do
1616
{

0 commit comments

Comments
 (0)