aboutsummaryrefslogtreecommitdiff
path: root/lib/std/json/write_stream.zig
diff options
context:
space:
mode:
authorSebastian Keller <sebastiankeller@fastmail.net>2019-10-27 20:15:48 +0100
committerSebastian Keller <sebastiankeller@fastmail.net>2019-10-27 20:15:48 +0100
commitac705a7bb6ddafa1a8a7bfafe9e61f1246da8408 (patch)
tree436d2dd822b7172b29869652460d5f50581737f2 /lib/std/json/write_stream.zig
parent6257b4c5967e8153fc055025f712be6d0f7fc78b (diff)
downloadzig-ac705a7bb6ddafa1a8a7bfafe9e61f1246da8408.tar.gz
zig-ac705a7bb6ddafa1a8a7bfafe9e61f1246da8408.zip
Unified public api
Diffstat (limited to 'lib/std/json/write_stream.zig')
-rw-r--r--lib/std/json/write_stream.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/json/write_stream.zig b/lib/std/json/write_stream.zig
index 817ba3dd5b..bfa5647855 100644
--- 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();
},