this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

vxfw: update use of popOrNull, fix examples

+8 -8
+5 -5
examples/fuzzy.zig
··· 207 207 var fd = std.process.Child.init(&.{"fd"}, allocator); 208 208 fd.stdout_behavior = .Pipe; 209 209 fd.stderr_behavior = .Pipe; 210 - var stdout = std.ArrayList(u8).init(allocator); 211 - var stderr = std.ArrayList(u8).init(allocator); 212 - defer stdout.deinit(); 213 - defer stderr.deinit(); 210 + var stdout: std.ArrayListUnmanaged(u8) = .empty; 211 + var stderr: std.ArrayListUnmanaged(u8) = .empty; 212 + defer stdout.deinit(allocator); 213 + defer stderr.deinit(allocator); 214 214 try fd.spawn(); 215 - try fd.collectOutput(&stdout, &stderr, 10_000_000); 215 + try fd.collectOutput(allocator, &stdout, &stderr, 10_000_000); 216 216 _ = try fd.wait(); 217 217 218 218 var iter = std.mem.splitScalar(u8, stdout.items, '\n');
+3 -3
src/vxfw/App.zig
··· 288 288 const now_ms = std.time.milliTimestamp(); 289 289 290 290 // timers are always sorted descending 291 - while (self.timers.popOrNull()) |tick| { 291 + while (self.timers.pop()) |tick| { 292 292 if (now_ms < tick.deadline_ms) { 293 293 // re-add the timer 294 294 try self.timers.append(tick); ··· 446 446 self.last_hit_list = try app.allocator.dupe(vxfw.HitResult, hits.items); 447 447 } 448 448 449 - const target = hits.popOrNull() orelse return; 449 + const target = hits.pop() orelse return; 450 450 451 451 // capturing phase 452 452 ctx.phase = .capturing; ··· 474 474 475 475 // Bubbling phase 476 476 ctx.phase = .bubbling; 477 - while (hits.popOrNull()) |item| { 477 + while (hits.pop()) |item| { 478 478 var m_local = mouse; 479 479 m_local.col = item.local.col; 480 480 m_local.row = item.local.row;