From 95fbeb5b821cfd3cfdbb3340a8638c0031eb7336 Mon Sep 17 00:00:00 2001 From: Qwerasd Date: Mon, 30 Jun 2025 16:44:21 -0600 Subject: [PATCH] style(font/sprite): annotate type for value --- src/font/sprite/Face.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/font/sprite/Face.zig b/src/font/sprite/Face.zig index 8c39daef4..1463fb38b 100644 --- a/src/font/sprite/Face.zig +++ b/src/font/sprite/Face.zig @@ -54,7 +54,7 @@ const Range = struct { /// Automatically collect ranges for functions with names /// in the format `draw` or `draw_`. -const ranges = ranges: { +const ranges: []const Range = ranges: { @setEvalBranchQuota(1_000_000); // Structs containing drawing functions for codepoint ranges. @@ -137,7 +137,11 @@ const ranges = ranges: { i = n.max; } - break :ranges r; + // We need to copy in to a const rather than a var in order to take + // the reference at comptime so that we can break with a slice here. + const fixed = r; + + break :ranges &fixed; }; fn getDrawFn(cp: u32) ?*const DrawFn {