Skip to content

Commit 6038192

Browse files
committed
std.tar: delete function redundant with std.mem
1 parent 2e8dbca commit 6038192

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

lib/std/tar/Writer.zig

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,8 @@ pub const Header = extern struct {
346346
for (cases) |case| {
347347
var header = Header.init(.regular);
348348
try header.setPath(case.in[0], case.in[1]);
349-
try testing.expectEqualStrings(case.out[0], str(&header.prefix));
350-
try testing.expectEqualStrings(case.out[1], str(&header.name));
349+
try testing.expectEqualStrings(case.out[0], std.mem.sliceTo(&header.prefix, 0));
350+
try testing.expectEqualStrings(case.out[1], std.mem.sliceTo(&header.name, 0));
351351
}
352352

353353
const error_cases = [_]struct {
@@ -370,14 +370,6 @@ pub const Header = extern struct {
370370
);
371371
}
372372
}
373-
374-
// Breaks string on first null character.
375-
fn str(s: []const u8) []const u8 {
376-
for (s, 0..) |c, i| {
377-
if (c == 0) return s[0..i];
378-
}
379-
return s;
380-
}
381373
};
382374

383375
test {

0 commit comments

Comments
 (0)