diff options
| author | gingerBill <bill@gingerbill.org> | 2020-12-03 10:45:26 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-12-03 10:45:26 +0000 |
| commit | 18da0b3418511c013cc3a06df72f50d4abc00042 (patch) | |
| tree | a5320fae053df9b051068bd6ecc066135a9389a2 /core/encoding | |
| parent | 334a8c46e8b969537b6c3304f19620309ab9e7f4 (diff) | |
Integrate `package io` into core library
Diffstat (limited to 'core/encoding')
| -rw-r--r-- | core/encoding/json/marshal.odin | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/encoding/json/marshal.odin b/core/encoding/json/marshal.odin index 52854fc80..7bdc3abc3 100644 --- a/core/encoding/json/marshal.odin +++ b/core/encoding/json/marshal.odin @@ -14,7 +14,8 @@ Marshal_Error :: enum { } marshal :: proc(v: any, allocator := context.allocator) -> ([]byte, Marshal_Error) { - b := strings.make_builder(allocator); + b: strings.Builder; + strings.init_builder(&b, allocator); err := marshal_arg(&b, v); @@ -129,7 +130,7 @@ marshal_arg :: proc(b: ^strings.Builder, v: any) -> Marshal_Error { case b32: val = bool(b); case b64: val = bool(b); } - write_string(b, val ? "true" : "false"); + write_string_builder(b, val ? "true" : "false"); case Type_Info_Any: return .Unsupported_Type; |