aboutsummaryrefslogtreecommitdiff
path: root/lib/std/json.zig
diff options
context:
space:
mode:
authorVexu <git@vexu.eu>2020-07-11 14:09:04 +0300
committerVexu <git@vexu.eu>2020-07-11 20:41:19 +0300
commite85fe13e44b1e2957b9d90e19c171fdfa8cb5505 (patch)
tree17880994dab9c0033cc139b677711f45a87ca637 /lib/std/json.zig
parent8110639c7964fcb23c2b715f97ab6caa27506b93 (diff)
downloadzig-e85fe13e44b1e2957b9d90e19c171fdfa8cb5505.tar.gz
zig-e85fe13e44b1e2957b9d90e19c171fdfa8cb5505.zip
run zig fmt on std lib and self hosted
Diffstat (limited to 'lib/std/json.zig')
-rw-r--r--lib/std/json.zig16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/std/json.zig b/lib/std/json.zig
index 65ebe55072..f1b91fc829 100644
--- a/lib/std/json.zig
+++ b/lib/std/json.zig
@@ -239,7 +239,7 @@ pub const StreamingParser = struct {
NullLiteral3,
// Only call this function to generate array/object final state.
- pub fn fromInt(x: var) State {
+ pub fn fromInt(x: anytype) State {
debug.assert(x == 0 or x == 1);
const T = @TagType(State);
return @intToEnum(State, @intCast(T, x));
@@ -1236,7 +1236,7 @@ pub const Value = union(enum) {
pub fn jsonStringify(
value: @This(),
options: StringifyOptions,
- out_stream: var,
+ out_stream: anytype,
) @TypeOf(out_stream).Error!void {
switch (value) {
.Null => try stringify(null, options, out_stream),
@@ -2338,7 +2338,7 @@ pub const StringifyOptions = struct {
pub fn outputIndent(
whitespace: @This(),
- out_stream: var,
+ out_stream: anytype,
) @TypeOf(out_stream).Error!void {
var char: u8 = undefined;
var n_chars: usize = undefined;
@@ -2380,7 +2380,7 @@ pub const StringifyOptions = struct {
fn outputUnicodeEscape(
codepoint: u21,
- out_stream: var,
+ out_stream: anytype,
) !void {
if (codepoint <= 0xFFFF) {
// If the character is in the Basic Multilingual Plane (U+0000 through U+FFFF),
@@ -2402,9 +2402,9 @@ fn outputUnicodeEscape(
}
pub fn stringify(
- value: var,
+ value: anytype,
options: StringifyOptions,
- out_stream: var,
+ out_stream: anytype,
) @TypeOf(out_stream).Error!void {
const T = @TypeOf(value);
switch (@typeInfo(T)) {
@@ -2584,7 +2584,7 @@ pub fn stringify(
unreachable;
}
-fn teststringify(expected: []const u8, value: var, options: StringifyOptions) !void {
+fn teststringify(expected: []const u8, value: anytype, options: StringifyOptions) !void {
const ValidationOutStream = struct {
const Self = @This();
pub const OutStream = std.io.OutStream(*Self, Error, write);
@@ -2758,7 +2758,7 @@ test "stringify struct with custom stringifier" {
pub fn jsonStringify(
value: Self,
options: StringifyOptions,
- out_stream: var,
+ out_stream: anytype,
) !void {
try out_stream.writeAll("[\"something special\",");
try stringify(42, options, out_stream);