Carry-over stream error to JSON.stringify

This commit is contained in:
Benjamin Feng
2020-03-24 19:14:32 -05:00
committed by Andrew Kelley
parent ee6fda2297
commit 9dbfee49d7

View File

@@ -2249,16 +2249,11 @@ pub const StringifyOptions = struct {
// TODO: allow picking if []u8 is string or array?
};
pub const StringifyError = error{
TooMuchData,
DifferentData,
};
pub fn stringify(
value: var,
options: StringifyOptions,
out_stream: var,
) StringifyError!void {
) @TypeOf(out_stream).Error!void {
const T = @TypeOf(value);
switch (@typeInfo(T)) {
.Float, .ComptimeFloat => {