aboutsummaryrefslogtreecommitdiff
path: root/lib/std/meta.zig
diff options
context:
space:
mode:
authorCassidy Dingenskirchen <admin@15318.de>2020-06-12 16:32:02 +0200
committerAndrew Kelley <andrew@ziglang.org>2020-06-12 13:33:31 -0400
commit57f1ed5325eeb3c3ca62af62a104f840881248f0 (patch)
treee4d51ad2253abd16d569f0abc160d883512c43e5 /lib/std/meta.zig
parent7d8fd452672e1fcf3692da0f52d480415b67e1ea (diff)
downloadzig-57f1ed5325eeb3c3ca62af62a104f840881248f0.tar.gz
zig-57f1ed5325eeb3c3ca62af62a104f840881248f0.zip
Fix a few std.sort.sort invocations
Diffstat (limited to 'lib/std/meta.zig')
-rw-r--r--lib/std/meta.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/meta.zig b/lib/std/meta.zig
index f5c4ab59fd..75f507da74 100644
--- a/lib/std/meta.zig
+++ b/lib/std/meta.zig
@@ -145,8 +145,8 @@ test "std.meta.Child" {
/// Given a "memory span" type, returns the "element type".
pub fn Elem(comptime T: type) type {
switch (@typeInfo(T)) {
- .Array, => |info| return info.child,
- .Vector, => |info| return info.child,
+ .Array => |info| return info.child,
+ .Vector => |info| return info.child,
.Pointer => |info| switch (info.size) {
.One => switch (@typeInfo(info.child)) {
.Array => |array_info| return array_info.child,
@@ -658,7 +658,7 @@ pub fn refAllDecls(comptime T: type) void {
/// Returns a slice of pointers to public declarations of a namespace.
pub fn declList(comptime Namespace: type, comptime Decl: type) []const *const Decl {
const S = struct {
- fn declNameLessThan(lhs: *const Decl, rhs: *const Decl) bool {
+ fn declNameLessThan(context: void, lhs: *const Decl, rhs: *const Decl) bool {
return mem.lessThan(u8, lhs.name, rhs.name);
}
};
@@ -668,7 +668,7 @@ pub fn declList(comptime Namespace: type, comptime Decl: type) []const *const De
for (decls) |decl, i| {
array[i] = &@field(Namespace, decl.name);
}
- std.sort.sort(*const Decl, &array, S.declNameLessThan);
+ std.sort.sort(*const Decl, &array, {}, S.declNameLessThan);
return &array;
}
}