We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e40c3a2 commit 63bc967Copy full SHA for 63bc967
1 file changed
src/utils.zig
@@ -2,8 +2,8 @@ const std = @import("std");
2
3
pub fn NonOptional(comptime T: type) type {
4
const type_info = @typeInfo(T);
5
- if (type_info == .Optional) {
6
- return type_info.Optional.child;
+ if (type_info == .optional) {
+ return type_info.optional.child;
7
}
8
return T;
9
@@ -13,7 +13,7 @@ pub fn Optional(comptime T: type, comptime is_optional: bool) type {
13
14
15
pub inline fn isOptional(comptime T: type) bool {
16
- return @typeInfo(T) == .Optional;
+ return @typeInfo(T) == .optional;
17
18
19
test isOptional {
0 commit comments