From ac6ddf829d60849176fa5c7e89d695da0849d05e Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Thu, 18 Dec 2025 18:01:20 -0800 Subject: [PATCH] location_query is never null --- src/http/handler.zig | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/http/handler.zig b/src/http/handler.zig index c51df40..e87e847 100644 --- a/src/http/handler.zig +++ b/src/http/handler.zig @@ -87,7 +87,7 @@ fn handleWeatherInternal( opts: *HandleWeatherOptions, req: *httpz.Request, res: *httpz.Response, - location_query: ?[]const u8, + location_query: []const u8, ) !void { const allocator = req.arena; @@ -100,11 +100,10 @@ fn handleWeatherInternal( } // Resolve location - const loc_str = location_query orelse ""; - const location = if (loc_str.len == 0) + const location = if (location_query.len == 0) Location{ .name = "London", .coords = .{ .latitude = 51.5074, .longitude = -0.1278 } } else - opts.resolver.resolve(loc_str) catch |err| { + opts.resolver.resolve(location_query) catch |err| { switch (err) { error.LocationNotFound => { res.status = 404;