diff options
| author | Benjamin Feng <benjamin.feng@glassdoor.com> | 2020-03-06 16:59:21 -0600 |
|---|---|---|
| committer | Benjamin Feng <benjamin.feng@glassdoor.com> | 2020-03-12 10:41:09 -0500 |
| commit | 4aae55b4ccf44fa3c2c2a81a6a34f3c898dece30 (patch) | |
| tree | a4116c5259e3f39df939008f23ac66f65ce61194 /lib/std/json.zig | |
| parent | ed7f30e1cd0c00c82c511ad826fe8d8b60b2f57f (diff) | |
| download | zig-4aae55b4ccf44fa3c2c2a81a6a34f3c898dece30.tar.gz zig-4aae55b4ccf44fa3c2c2a81a6a34f3c898dece30.zip | |
Replace fmt with new fmtstream
Diffstat (limited to 'lib/std/json.zig')
| -rw-r--r-- | lib/std/json.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/std/json.zig b/lib/std/json.zig index f3a0811078..f5a72d86da 100644 --- a/lib/std/json.zig +++ b/lib/std/json.zig @@ -2257,10 +2257,10 @@ pub fn stringify( const T = @TypeOf(value); switch (@typeInfo(T)) { .Float, .ComptimeFloat => { - return std.fmtstream.formatFloatScientific(value, std.fmtstream.FormatOptions{}, out_stream); + return std.fmt.formatFloatScientific(value, std.fmt.FormatOptions{}, out_stream); }, .Int, .ComptimeInt => { - return std.fmtstream.formatIntValue(value, "", std.fmtstream.FormatOptions{}, out_stream); + return std.fmt.formatIntValue(value, "", std.fmt.FormatOptions{}, out_stream); }, .Bool => { return out_stream.writeAll(if (value) "true" else "false"); @@ -2350,16 +2350,16 @@ pub fn stringify( // then it may be represented as a six-character sequence: a reverse solidus, followed // by the lowercase letter u, followed by four hexadecimal digits that encode the character's code point. try out_stream.writeAll("\\u"); - try std.fmtstream.formatIntValue(codepoint, "x", std.fmtstream.FormatOptions{ .width = 4, .fill = '0' }, out_stream); + try std.fmt.formatIntValue(codepoint, "x", std.fmt.FormatOptions{ .width = 4, .fill = '0' }, out_stream); } else { // To escape an extended character that is not in the Basic Multilingual Plane, // the character is represented as a 12-character sequence, encoding the UTF-16 surrogate pair. const high = @intCast(u16, (codepoint - 0x10000) >> 10) + 0xD800; const low = @intCast(u16, codepoint & 0x3FF) + 0xDC00; try out_stream.writeAll("\\u"); - try std.fmtstream.formatIntValue(high, "x", std.fmtstream.FormatOptions{ .width = 4, .fill = '0' }, out_stream); + try std.fmt.formatIntValue(high, "x", std.fmt.FormatOptions{ .width = 4, .fill = '0' }, out_stream); try out_stream.writeAll("\\u"); - try std.fmtstream.formatIntValue(low, "x", std.fmtstream.FormatOptions{ .width = 4, .fill = '0' }, out_stream); + try std.fmt.formatIntValue(low, "x", std.fmt.FormatOptions{ .width = 4, .fill = '0' }, out_stream); } i += ulen - 1; }, |
