| ... | ... | @@ -912,7 +912,7 @@ pub fn BitOutStream(endian: builtin.Endian, comptime Error: type) type { |
| 912 | 912 | } |
| 913 | 913 | |
| 914 | 914 | /// Flush any remaining bits to the stream. |
| 915 | | pub fn flushBits(self: *Self) !void { |
| 915 | pub fn flushBits(self: *Self) Error!void { |
| 916 | 916 | if (self.bit_count == 0) return; |
| 917 | 917 | try self.out_stream.writeByte(self.bit_buffer); |
| 918 | 918 | self.bit_buffer = 0; |
| ... | ... | @@ -1079,7 +1079,7 @@ pub fn Deserializer(comptime endian: builtin.Endian, is_packed: bool, comptime E |
| 1079 | 1079 | } |
| 1080 | 1080 | |
| 1081 | 1081 | //@BUG: inferred error issue. See: #1386 |
| 1082 | | fn deserializeInt(self: *Self, comptime T: type) (Stream.Error || error{EndOfStream})!T { |
| 1082 | fn deserializeInt(self: *Self, comptime T: type) (Error || error{EndOfStream})!T { |
| 1083 | 1083 | comptime assert(trait.is(builtin.TypeId.Int)(T) or trait.is(builtin.TypeId.Float)(T)); |
| 1084 | 1084 | |
| 1085 | 1085 | const u8_bit_count = 8; |
| ... | ... | @@ -1287,11 +1287,11 @@ pub fn Serializer(comptime endian: builtin.Endian, comptime is_packed: bool, com |
| 1287 | 1287 | } |
| 1288 | 1288 | |
| 1289 | 1289 | /// Flushes any unwritten bits to the stream |
| 1290 | | pub fn flush(self: *Self) Stream.Error!void { |
| 1290 | pub fn flush(self: *Self) Error!void { |
| 1291 | 1291 | if (is_packed) return self.out_stream.flushBits(); |
| 1292 | 1292 | } |
| 1293 | 1293 | |
| 1294 | | fn serializeInt(self: *Self, value: var) !void { |
| 1294 | fn serializeInt(self: *Self, value: var) Error!void { |
| 1295 | 1295 | const T = @typeOf(value); |
| 1296 | 1296 | comptime assert(trait.is(builtin.TypeId.Int)(T) or trait.is(builtin.TypeId.Float)(T)); |
| 1297 | 1297 | |
| ... | ... | @@ -1323,7 +1323,7 @@ pub fn Serializer(comptime endian: builtin.Endian, comptime is_packed: bool, com |
| 1323 | 1323 | } |
| 1324 | 1324 | |
| 1325 | 1325 | /// Serializes the passed value into the stream |
| 1326 | | pub fn serialize(self: *Self, value: var) !void { |
| 1326 | pub fn serialize(self: *Self, value: var) Error!void { |
| 1327 | 1327 | const T = comptime @typeOf(value); |
| 1328 | 1328 | |
| 1329 | 1329 | if (comptime trait.isIndexable(T)) { |