aboutsummaryrefslogtreecommitdiff
path: root/lib/std/json.zig
diff options
context:
space:
mode:
authorjoachimschmidt557 <joachim.schmidt557@outlook.com>2020-07-04 13:44:28 +0200
committerVeikka Tuominen <git@vexu.eu>2020-07-04 21:40:06 +0300
commit0ae1157e4553d6f54e0d489daebb006c402e0f63 (patch)
treea182d250d6b86db25e60950916a923bcd47de234 /lib/std/json.zig
parent672b4d5c24ab6c4d8ddf1ec7a1a7753a2d21dc87 (diff)
downloadzig-0ae1157e4553d6f54e0d489daebb006c402e0f63.tar.gz
zig-0ae1157e4553d6f54e0d489daebb006c402e0f63.zip
std.mem.dupe is deprecated, move all references in std
Replaced all occurences of std.mem.dupe in stdlib with Allocator.dupe/std.mem.dupeZ -> Allocator.dupeZ
Diffstat (limited to 'lib/std/json.zig')
-rw-r--r--lib/std/json.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/json.zig b/lib/std/json.zig
index 6377b69a80..20eed05737 100644
--- a/lib/std/json.zig
+++ b/lib/std/json.zig
@@ -1567,7 +1567,7 @@ fn parseInternal(comptime T: type, token: Token, tokens: *TokenStream, options:
if (ptrInfo.child != u8) return error.UnexpectedToken;
const source_slice = stringToken.slice(tokens.slice, tokens.i - 1);
switch (stringToken.escapes) {
- .None => return mem.dupe(allocator, u8, source_slice),
+ .None => return allocator.dupe(u8, source_slice),
.Some => |some_escapes| {
const output = try allocator.alloc(u8, stringToken.decodedLength());
errdefer allocator.free(output);
@@ -2043,7 +2043,7 @@ pub const Parser = struct {
fn parseString(p: *Parser, allocator: *Allocator, s: std.meta.TagPayloadType(Token, Token.String), input: []const u8, i: usize) !Value {
const slice = s.slice(input, i);
switch (s.escapes) {
- .None => return Value{ .String = if (p.copy_strings) try mem.dupe(allocator, u8, slice) else slice },
+ .None => return Value{ .String = if (p.copy_strings) try allocator.dupe(u8, slice) else slice },
.Some => |some_escapes| {
const output = try allocator.alloc(u8, s.decodedLength());
errdefer allocator.free(output);