std.tz: fix function returning pointer to local variable

This commit is contained in:
Veikka Tuominen 2022-06-15 18:34:56 +03:00
parent b9dcbe6b4c
commit a224dfceee

View File

@ -11,7 +11,7 @@ pub const Timetype = struct {
flags: u8,
name_data: [6:0]u8,
pub fn name(self: Timetype) [:0]const u8 {
pub fn name(self: *const Timetype) [:0]const u8 {
return std.mem.sliceTo(self.name_data[0..], 0);
}
@ -214,7 +214,6 @@ pub const Tz = struct {
};
test "slim" {
if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO
const data = @embedFile("tz/asia_tokyo.tzif");
var in_stream = std.io.fixedBufferStream(data);
@ -228,7 +227,6 @@ test "slim" {
}
test "fat" {
if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO
const data = @embedFile("tz/antarctica_davis.tzif");
var in_stream = std.io.fixedBufferStream(data);
@ -241,7 +239,6 @@ test "fat" {
}
test "legacy" {
if (@import("builtin").zig_backend != .stage1) return error.SkipZigTest; // TODO
// Taken from Slackware 8.0, from 2001
const data = @embedFile("tz/europe_vatican.tzif");
var in_stream = std.io.fixedBufferStream(data);