| ... | @@ -426,10 +426,8 @@ pub const Document = struct { | ... | @@ -426,10 +426,8 @@ pub const Document = struct { |
| 426 | doc = null; | 426 | doc = null; |
| 427 | } | 427 | } |
| 428 | | 428 | |
| 429 | pub fn format(this: *const Document, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void { | 429 | pub fn nprint(this: *const Document, writer: anytype) !void { |
| 430 | _ = fmt; | 430 | return nio.fmt.format(writer, "{}", .{this.root}); |
| 431 | _ = options; | | |
| 432 | return std.fmt.format(writer, "{}", .{this.root}); | | |
| 433 | } | 431 | } |
| 434 | | 432 | |
| 435 | pub fn stringify(this: *const Document, writer: anytype, space: Space, indent: u8) Instance(@TypeOf(writer)).WriteError!void { | 433 | pub fn stringify(this: *const Document, writer: anytype, space: Space, indent: u8) Instance(@TypeOf(writer)).WriteError!void { |
| ... | @@ -449,10 +447,8 @@ pub const ValueIndex = enum(u32) { | ... | @@ -449,10 +447,8 @@ pub const ValueIndex = enum(u32) { |
| 449 | empty_object = 14, | 447 | empty_object = 14, |
| 450 | _, | 448 | _, |
| 451 | | 449 | |
| 452 | pub fn format(this: ValueIndex, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void { | 450 | pub fn nprint(this: ValueIndex, writer: anytype) !void { |
| 453 | _ = fmt; | 451 | return nio.fmt.format(writer, "{}", .{this.v()}); |
| 454 | _ = options; | | |
| 455 | return std.fmt.format(writer, "{}", .{this.v()}); | | |
| 456 | } | 452 | } |
| 457 | | 453 | |
| 458 | fn stringify(this: ValueIndex, writer: anytype, space: Space, indent: u8) !void { | 454 | fn stringify(this: ValueIndex, writer: anytype, space: Space, indent: u8) !void { |
| ... | @@ -508,15 +504,13 @@ pub const Value = union(enum(u8)) { | ... | @@ -508,15 +504,13 @@ pub const Value = union(enum(u8)) { |
| 508 | | 504 | |
| 509 | const Tag = std.meta.Tag(@This()); | 505 | const Tag = std.meta.Tag(@This()); |
| 510 | | 506 | |
| 511 | pub fn format(this: Value, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void { | 507 | pub fn nprint(this: Value, writer: anytype) !void { |
| 512 | _ = options; | | |
| 513 | _ = fmt; | | |
| 514 | return switch (this) { | 508 | return switch (this) { |
| 515 | .zero => unreachable, | 509 | .zero => unreachable, |
| 516 | .null => std.fmt.format(writer, "null", .{}), | 510 | .null => nio.fmt.format(writer, "null", .{}), |
| 517 | .true => std.fmt.format(writer, "true", .{}), | 511 | .true => nio.fmt.format(writer, "true", .{}), |
| 518 | .false => std.fmt.format(writer, "false", .{}), | 512 | .false => nio.fmt.format(writer, "false", .{}), |
| 519 | inline .object, .array, .string, .number => |t| std.fmt.format(writer, "{}", .{t}), | 513 | inline .object, .array, .string, .number => |t| nio.fmt.format(writer, "{}", .{t}), |
| 520 | }; | 514 | }; |
| 521 | } | 515 | } |
| 522 | | 516 | |
| ... | @@ -537,9 +531,7 @@ pub const Array = []align(1) const ValueIndex; | ... | @@ -537,9 +531,7 @@ pub const Array = []align(1) const ValueIndex; |
| 537 | pub const StringIndex = enum(u32) { | 531 | pub const StringIndex = enum(u32) { |
| 538 | _, | 532 | _, |
| 539 | | 533 | |
| 540 | pub fn format(this: StringIndex, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void { | 534 | pub fn nprint(this: StringIndex, writer: anytype) !void { |
| 541 | _ = options; | | |
| 542 | _ = fmt; | | |
| 543 | try writer.writeAll("\""); | 535 | try writer.writeAll("\""); |
| 544 | try writer.writeAll(this.to()); | 536 | try writer.writeAll(this.to()); |
| 545 | try writer.writeAll("\""); | 537 | try writer.writeAll("\""); |
| ... | @@ -562,10 +554,7 @@ pub const StringIndex = enum(u32) { | ... | @@ -562,10 +554,7 @@ pub const StringIndex = enum(u32) { |
| 562 | pub const ArrayIndex = enum(u32) { | 554 | pub const ArrayIndex = enum(u32) { |
| 563 | _, | 555 | _, |
| 564 | | 556 | |
| 565 | pub fn format(this: ArrayIndex, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void { | 557 | pub fn nprint(this: ArrayIndex, writer: anytype) !void { |
| 566 | _ = options; | | |
| 567 | _ = fmt; | | |
| 568 | | | |
| 569 | const items = this.to(); | 558 | const items = this.to(); |
| 570 | try writer.writeAll("["); | 559 | try writer.writeAll("["); |
| 571 | for (items, 0..) |item, i| { | 560 | for (items, 0..) |item, i| { |
| ... | @@ -602,9 +591,7 @@ pub const ArrayIndex = enum(u32) { | ... | @@ -602,9 +591,7 @@ pub const ArrayIndex = enum(u32) { |
| 602 | pub const ObjectIndex = enum(u32) { | 591 | pub const ObjectIndex = enum(u32) { |
| 603 | _, | 592 | _, |
| 604 | | 593 | |
| 605 | pub fn format(this: ObjectIndex, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void { | 594 | pub fn nprint(this: ObjectIndex, writer: anytype) !void { |
| 606 | _ = options; | | |
| 607 | _ = fmt; | | |
| 608 | const keys, const values = this.to(); | 595 | const keys, const values = this.to(); |
| 609 | try writer.writeAll("{"); | 596 | try writer.writeAll("{"); |
| 610 | for (keys, values, 0..) |k, v, i| { | 597 | for (keys, values, 0..) |k, v, i| { |
| ... | @@ -696,9 +683,7 @@ pub const ObjectIndex = enum(u32) { | ... | @@ -696,9 +683,7 @@ pub const ObjectIndex = enum(u32) { |
| 696 | pub const NumberIndex = enum(u32) { | 683 | pub const NumberIndex = enum(u32) { |
| 697 | _, | 684 | _, |
| 698 | | 685 | |
| 699 | pub fn format(this: NumberIndex, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void { | 686 | pub fn nprint(this: NumberIndex, writer: anytype) !void { |
| 700 | _ = options; | | |
| 701 | _ = fmt; | | |
| 702 | try writer.writeAll(this.to()); | 687 | try writer.writeAll(this.to()); |
| 703 | } | 688 | } |
| 704 | | 689 | |