authorgravatar for 57862114+momumi@users.noreply.github.commomumi <57862114+momumi@users.noreply.github.com> 2020-03-15 16:09:28+10:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-03-15 14:17:16-04:00
log880d8fc38089a406c6b3225148a6f50ae452cb6b
treeaceebff55c480134e40963e3641840ce4e35ad07
parenteb4d313dbc406b37f6bfdd98988c88c3b8ed542e

fix Serializer to work with new OutStream API


1 files changed, 5 insertions(+), 1 deletions(-)

lib/std/io/serialization.zig+5-1
...@@ -1,6 +1,10 @@...@@ -1,6 +1,10 @@
1const std = @import("../std.zig");1const std = @import("../std.zig");
2const builtin = std.builtin;2const builtin = std.builtin;
3const io = std.io;3const io = std.io;
4const assert = std.debug.assert;
5const math = std.math;
6const meta = std.meta;
7const trait = meta.trait;
48
5pub const Packing = enum {9pub const Packing = enum {
6 /// Pack data to byte alignment10 /// Pack data to byte alignment
...@@ -252,7 +256,7 @@ pub fn Serializer(comptime endian: builtin.Endian, comptime packing: Packing, co...@@ -252,7 +256,7 @@ pub fn Serializer(comptime endian: builtin.Endian, comptime packing: Packing, co
252 byte.* = if (t_bit_count < u8_bit_count) v else @truncate(u8, v);256 byte.* = if (t_bit_count < u8_bit_count) v else @truncate(u8, v);
253 }257 }
254258
255 try self.out_stream.write(&buffer);259 try self.out_stream.writeAll(&buffer);
256 }260 }
257261
258 /// Serializes the passed value into the stream262 /// Serializes the passed value into the stream