aboutsummaryrefslogtreecommitdiff
path: root/std/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'std/build.zig')
-rw-r--r--std/build.zig18
1 files changed, 9 insertions, 9 deletions
diff --git a/std/build.zig b/std/build.zig
index f944133d5b..29837b4ba4 100644
--- a/std/build.zig
+++ b/std/build.zig
@@ -488,15 +488,15 @@ pub const Builder = struct {
}
fn typeToEnum(comptime T: type) -> TypeId {
- if (@isInteger(T)) {
- TypeId.Int
- } else if (@isFloat(T)) {
- TypeId.Float
- } else switch (T) {
- bool => TypeId.Bool,
- []const u8 => TypeId.String,
- []const []const u8 => TypeId.List,
- else => @compileError("Unsupported type: " ++ @typeName(T)),
+ switch (@typeId(T)) {
+ builtin.TypeId.Int => TypeId.Int,
+ builtin.TypeId.Float => TypeId.Float,
+ builtin.TypeId.Bool => TypeId.Bool,
+ else => switch (T) {
+ []const u8 => TypeId.String,
+ []const []const u8 => TypeId.List,
+ else => @compileError("Unsupported type: " ++ @typeName(T)),
+ },
}
}