Skip to content

Commit

Permalink
Change std.mem.copy to @memcpy due to zig 0.12.0 change
Browse files Browse the repository at this point in the history
  • Loading branch information
edyu committed Dec 15, 2023
1 parent 3de8e97 commit 3443106
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/endpoint/users.zig
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ pub fn addByName(self: *Self, first: ?[]const u8, last: ?[]const u8) !usize {
user.lastnamelen = 0;

if (first) |firstname| {
std.mem.copy(u8, user.firstnamebuf[0..], firstname);
@memcpy(user.firstnamebuf[0..firstname.len], firstname);
user.firstnamelen = firstname.len;
}

if (last) |lastname| {
std.mem.copy(u8, user.lastnamebuf[0..], lastname);
@memcpy(user.lastnamebuf[0..lastname.len], lastname);
user.lastnamelen = lastname.len;
}

Expand Down Expand Up @@ -101,11 +101,11 @@ pub fn update(
pUser.firstnamelen = 0;
pUser.lastnamelen = 0;
if (first) |firstname| {
std.mem.copy(u8, pUser.firstnamebuf[0..], firstname);
@memcpy(pUser.firstnamebuf[0..firstname.len], firstname);
pUser.firstnamelen = firstname.len;
}
if (last) |lastname| {
std.mem.copy(u8, pUser.lastnamebuf[0..], lastname);
@memcpy(pUser.lastnamebuf[0..lastname.len], lastname);
pUser.lastnamelen = lastname.len;
}
}
Expand Down

0 comments on commit 3443106

Please sign in to comment.