diff --git a/src/app.zig b/src/app.zig index 271cbcc..7abe616 100644 --- a/src/app.zig +++ b/src/app.zig @@ -288,12 +288,8 @@ pub fn App(comptime E: type) type { .x = px -| 1, .y = py -| 1, .kind = blk: { - if (motion and button != Mouse.Button.none) { - break :blk .drag; - } - if (motion and button == Mouse.Button.none) { - break :blk .motion; - } + if (motion and button != Mouse.Button.none) break :blk .drag; + if (motion and button == Mouse.Button.none) break :blk .motion; if (sequence[sequence.len - 1] == 'm') break :blk .release; break :blk .press; }, diff --git a/src/element.zig b/src/element.zig index 3c72895..6e6e0b2 100644 --- a/src/element.zig +++ b/src/element.zig @@ -370,9 +370,8 @@ pub fn Input(Event: type, Queue: type) fn (meta.FieldEnum(Event)) type { const input_struct = struct { pub fn input_fn(accept_event: meta.FieldEnum(Event)) type { const event_type: enum { ascii, utf8 } = blk: { // check for type correctness and the associated type to use for the passed `accept_event` - const t = @FieldType(Event, @tagName(accept_event)); const err_msg = "Unexpected type for the associated input completion event to trigger. Only `[]u8` or `[]u21` are allowed."; - switch (@typeInfo(t)) { + switch (@typeInfo(@FieldType(Event, @tagName(accept_event)))) { .pointer => |pointer| { if (pointer.size != .slice) @compileError(err_msg); switch (@typeInfo(pointer.child)) {