std.json: Support disabling indent (#11823)

Newline Delimited JSON (ndjson) expect compact json without newline inside its content
Add None to StringfyOptions.indent and move newline writeByte inside StringfyOptions.outputIndent
This commit is contained in:
May B
2022-06-29 11:53:01 +02:00
committed by GitHub
parent 4a6b70fbd1
commit ea13437ac5
2 changed files with 20 additions and 7 deletions

View File

@@ -202,7 +202,6 @@ pub fn WriteStream(comptime OutStream: type, comptime max_depth: usize) type {
fn indent(self: *Self) !void {
assert(self.state_index >= 1);
try self.stream.writeByte('\n');
try self.whitespace.outputIndent(self.stream);
}