Skip to content

Commit c036957

Browse files
committed
std.meta.Elem: support all optional types
1 parent ace5714 commit c036957

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/std/meta.zig

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,7 @@ pub fn Elem(comptime T: type) type {
175175
},
176176
.Many, .C, .Slice => return info.child,
177177
},
178-
.Optional => |info| switch (@typeInfo(info.child)) {
179-
.Pointer => |ptr_info| switch (ptr_info.size) {
180-
.Many => return ptr_info.child,
181-
else => {},
182-
},
183-
else => {},
184-
},
178+
.Optional => |info| return Elem(info.child),
185179
else => {},
186180
}
187181
@compileError("Expected pointer, slice, array or vector type, found '" ++ @typeName(T) ++ "'");

0 commit comments

Comments
 (0)