mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 15:41:48 +00:00
Tweak generate.Tuple and generate.Union
Leverage comptime fields to give generated Tuple a default value, allowing TupleT and Tuple to be merged. Only call generate.Tuple on the final output. This eliminates redundant deduplication, and results in a simpler API (nested types just need to expose a natural Zig tuple). generate.Union leverages the new Tuple and removes unused features.
This commit is contained in:
@@ -37,12 +37,12 @@ const ProgressEvent = @import("../xhr/progress_event.zig").ProgressEvent;
|
||||
const log = std.log.scoped(.events);
|
||||
|
||||
// Event interfaces
|
||||
pub const Interfaces = generate.Tuple(.{
|
||||
pub const Interfaces = .{
|
||||
Event,
|
||||
ProgressEvent,
|
||||
});
|
||||
const Generated = generate.Union.compile(Interfaces);
|
||||
pub const Union = Generated._union;
|
||||
};
|
||||
|
||||
pub const Union = generate.Union(Interfaces);
|
||||
|
||||
// https://dom.spec.whatwg.org/#event
|
||||
pub const Event = struct {
|
||||
|
||||
Reference in New Issue
Block a user