From a821fe82d8de3d407ebe104358b97719bd983727 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 13:16:18 -0300 Subject: idioms #19, unreachable only where the type bounds it: the prints that carry a path, a name, a miss or a reason (Core's shell and Dump words, colors' theme file, look's misses and refusals) cut through Kind.Buf at their old size, the header texts flatSurface could still fail on and colors' putName handle the failure again, and every kept site (integers, a same-statement cut into a [K + room] buffer, the hashing and discarding writers) says its bound on its line Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/layout.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/layout.zig') diff --git a/src/layout.zig b/src/layout.zig index 0b11fe1b..3475dbbf 100644 --- a/src/layout.zig +++ b/src/layout.zig @@ -493,7 +493,7 @@ pub fn dropColumnUnannounced(p: *Pardes, c: usize) void { /// as /layout and /col name it. pub fn noteColumn(p: *Pardes, what: []const u8, serial: u32) void { var buf: [16]u8 = undefined; - pardes.ctlfs.events.notePath(p, what, std.fmt.bufPrint(&buf, "{d}", .{serial}) catch unreachable); // a u32 + pardes.ctlfs.events.notePath(p, what, std.fmt.bufPrint(&buf, "{d}", .{serial}) catch unreachable); // a u32 fits 16 } /// Fold column `c` into the one on its right, its panes below theirs. @@ -1741,7 +1741,7 @@ pub fn newColumn(p: *Pardes, from_id: usize) void { const c = insertColumnUnannounced(p, col, false) orelse { var said: [96]u8 = undefined; return p.reportFailure(from_id, if (p.view().ncol >= MAX_COLS) - std.fmt.bufPrint(&said, "Newcol: no space for a column: {d} max", .{MAX_COLS}) catch unreachable + std.fmt.bufPrint(&said, "Newcol: no space for a column: {d} max", .{MAX_COLS}) catch unreachable // an integer and 34 bytes fit 96 else "Newcol: no space for a column: this one is too narrow to split"); }; -- cgit v1.3