diff options
| author | Daniel Wennberg <daniel.wennberg@gmail.com> | 2025-09-18 12:39:19 -0700 |
|---|---|---|
| committer | Daniel Wennberg <daniel.wennberg@gmail.com> | 2025-09-18 12:39:19 -0700 |
| commit | 8fe9c579ef945228ccd4f604d23fd6670890cbfb (patch) | |
| tree | 65a416eeb207e7adf74fea253954eb66c4adcf85 /src/font/Collection.zig | |
| parent | 4af4e18725b7cdfd3632bcc7eabd5a82c465ea55 (diff) | |
Drop the nan sentinel; just fall through instead
Diffstat (limited to 'src/font/Collection.zig')
| -rw-r--r-- | src/font/Collection.zig | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/font/Collection.zig b/src/font/Collection.zig index 5a66749d6..0ab353a02 100644 --- a/src/font/Collection.zig +++ b/src/font/Collection.zig @@ -1489,11 +1489,10 @@ test "face metrics" { const actual = @field(metricsActual, field.name); // Unwrap optional fields const expectedValue, const actualValue = unwrap: switch (@typeInfo(field.type)) { - .optional => |Tinfo| { - if (expected) |expectedValue| { - const actualValue = actual orelse std.math.nan(Tinfo.child); + .optional => { + if (expected) |expectedValue| if (actual) |actualValue| { break :unwrap .{ expectedValue, actualValue }; - } + }; // Null values can be compared directly try std.testing.expectEqual(expected, actual); continue; |
