authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-02-14 07:26:47+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-03-12 01:35:43+01:00
log9c546031649ab3d94e30479ac2dbe6785bfc7f66
tree0ee67bb56e5ee377e1cd13c208f60268e21836f5
parentd6632b1dd281149a7219f910e90072a098cc5345

std: mem.SplitIterator.peek() can accept a const pointer


1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/mem.zig+1-1
...@@ -3462,7 +3462,7 @@ pub fn SplitIterator(comptime T: type, comptime delimiter_type: DelimiterType) t...@@ -3462,7 +3462,7 @@ pub fn SplitIterator(comptime T: type, comptime delimiter_type: DelimiterType) t
34623462
3463 /// Returns a slice of the next field, or null if splitting is complete.3463 /// Returns a slice of the next field, or null if splitting is complete.
3464 /// This method does not alter self.index.3464 /// This method does not alter self.index.
3465 pub fn peek(self: *Self) ?[]const T {3465 pub fn peek(self: *const Self) ?[]const T {
3466 const start = self.index orelse return null;3466 const start = self.index orelse return null;
3467 const end = if (switch (delimiter_type) {3467 const end = if (switch (delimiter_type) {
3468 .sequence => findPos(T, self.buffer, start, self.delimiter),3468 .sequence => findPos(T, self.buffer, start, self.delimiter),