aboutsummaryrefslogtreecommitdiff
path: root/src/json.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/json.c b/src/json.c
index 6f00da8..af93d06 100644
--- a/src/json.c
+++ b/src/json.c
@@ -38,7 +38,7 @@ JSON JSON_array(Vec items) {
return json;
}
-JSON JSON_string(Str value) {
+JSON JSON_string(StrView value) {
JSON json = {0};
json.type = JSON_STRING;
json.as.string = value;
@@ -72,7 +72,7 @@ i32 JSON_fprint(FILE *w, JSON json) {
switch (json.type) {
case JSON_STRING:
fprintf(w, "\"");
- Str_fprint(w, json.as.string);
+ StrView_fprint(w, json.as.string);
return fprintf(w, "\"");
case JSON_INTEGER:
return fprintf(w, "%d", json.as.integer);
@@ -182,8 +182,8 @@ parse_result parse_string(Arena *a, byte *src, uptr start_pos) {
result.pos++;
}
assert(src[result.pos] == '"');
- result.value = JSON_string(
- Str_copy(a, &src[start_pos + 1], result.pos - start_pos - 1));
+ result.value =
+ JSON_string(Str_view(&src[start_pos + 1], result.pos - start_pos - 1));
result.pos++;
return result;