Add @intCast in Range size hint to support signed integer types

This commit is contained in:
Luuk Machielse 2025-12-09 19:20:45 +01:00
parent 0928cb3f98
commit 7ec0bf20dc

View file

@ -365,7 +365,7 @@ pub fn Range(comptime T: type, end_type: RangeEndType) type {
} }
pub fn sizeHint(self: *const Self) usize { pub fn sizeHint(self: *const Self) usize {
return self.end - self.current + @intFromBool(end_type == .inclusive); return @intCast(self.end - self.current + @intFromBool(end_type == .inclusive));
} }
}; };
} }