zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit ac705a7bb6ddafa1a8a7bfafe9e61f1246da8408 (tree)
parent 6257b4c5967e8153fc055025f712be6d0f7fc78b
Author: Sebastian Keller <sebastiankeller@fastmail.net>
Date:   Sun, 27 Oct 2019 20:15:48 +0100

Unified public api

Diffstat:
Mlib/std/json/write_stream.zig | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/std/json/write_stream.zig b/lib/std/json/write_stream.zig @@ -198,7 +198,7 @@ pub fn WriteStream(comptime OutStream: type, comptime max_depth: usize) type { } /// Writes the complete json into the output stream - pub fn writeJson(self: *Self, json: std.json.Value) std.os.WriteError!void { + pub fn emitJson(self: *Self, json: std.json.Value) Stream.Error!void { switch (json) { .Null => try self.emitNull(), .Bool => |inner| try self.emitBool(inner), @@ -209,7 +209,7 @@ pub fn WriteStream(comptime OutStream: type, comptime max_depth: usize) type { try self.beginArray(); for (inner.toSliceConst()) |elem| { try self.arrayElem(); - try self.writeJson(elem); + try self.emitJson(elem); } try self.endArray(); }, @@ -218,7 +218,7 @@ pub fn WriteStream(comptime OutStream: type, comptime max_depth: usize) type { var it = inner.iterator(); while (it.next()) |entry| { try self.objectField(entry.key); - try self.writeJson(entry.value); + try self.emitJson(entry.value); } try self.endObject(); },