mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 00:35:10 +00:00
Remove isIntegerNumber and isFloatingNumber
This commit is contained in:
parent
5042a47682
commit
8467373bb8
@ -298,20 +298,6 @@ pub fn isNumber(comptime T: type) bool {
|
||||
};
|
||||
}
|
||||
|
||||
pub fn isIntegerNumber(comptime T: type) bool {
|
||||
return switch (@typeInfo(T)) {
|
||||
.Int, .ComptimeInt => true,
|
||||
else => false,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn isFloatingNumber(comptime T: type) bool {
|
||||
return switch (@typeInfo(T)) {
|
||||
.Float, .ComptimeFloat => true,
|
||||
else => false,
|
||||
};
|
||||
}
|
||||
|
||||
test "std.meta.trait.isNumber" {
|
||||
const NotANumber = struct {
|
||||
number: u8,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user