Drop the nan sentinel; just fall through instead

pull/8738/head
Daniel Wennberg 2025-09-18 12:39:19 -07:00
parent 4af4e18725
commit 8fe9c579ef
1 changed files with 3 additions and 4 deletions

View File

@ -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;