diff --git a/src/weather/Provider.zig b/src/weather/Provider.zig index d9a3852..490428e 100644 --- a/src/weather/Provider.zig +++ b/src/weather/Provider.zig @@ -23,8 +23,8 @@ pub const VTable = struct { pub fn fetch(self: WeatherProvider, allocator: std.mem.Allocator, coords: Coordinates) !types.WeatherData { // Generate cache key from coordinates - const cache_key = try std.fmt.allocPrint(allocator, "{d:.4},{d:.4}", .{ coords.latitude, coords.longitude }); - defer allocator.free(cache_key); + var buf: [256]u8 = undefined; + const cache_key = try std.fmt.bufPrint(&buf, "{d:.4},{d:.4}", .{ coords.latitude, coords.longitude }); // Check cache first if (self.cache.get(cache_key)) |cached_raw|