#It is possible to have optional anonymous struct literals?
1 messages · Page 1 of 1 (latest)
Not really, you should just define a struct and then do const a1: MyConfigStruct = .{ ... };
You could also do it with an anonymous struct type: ```rs
const a1: struct {
b: ?struct {
c: u32,
},
} = .{ .b = .{ .c = 1 } };
Yeah, the ? declares an optional type, but anon struct literals are values, not types. null on the other hand is a value, which is why a1 works.