From 80f4398f1fed8d46d73cab8045005c02189b34fc Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 12:40:11 -0300 Subject: idioms #14, the rest: wire's has_cell_pixels (@hasField on a struct that always has the field) goes with its comptime branches, syntax's predicate ops are a stringToEnum switch, the public surfaces of sam_edit, locations, Names, Macro, selection_pipe, recent and builtins_json name their sets (OutOfMemory, Writer.Error), and std.fs.path and max_path_bytes are std.Io.Dir's Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/Macro.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Macro.zig') diff --git a/src/Macro.zig b/src/Macro.zig index 7475992e..b619e523 100644 --- a/src/Macro.zig +++ b/src/Macro.zig @@ -91,7 +91,7 @@ const names = [_]struct { cp: u21, name: []const u8 }{ /// Keys in helix's notation: a plain character as itself, anything else /// in angle brackets with its modifiers (``, ``, ``). -pub fn encode(gpa: std.mem.Allocator, keys: []const Stored) ![]u8 { +pub fn encode(gpa: std.mem.Allocator, keys: []const Stored) error{OutOfMemory}![]u8 { var out: std.ArrayList(u8) = .empty; errdefer out.deinit(gpa); for (keys) |k| { @@ -117,7 +117,7 @@ pub fn encode(gpa: std.mem.Allocator, keys: []const Stored) ![]u8 { } /// The keys helix notation names; what it cannot read ends the list. -pub fn decode(gpa: std.mem.Allocator, text: []const u8) ![]Stored { +pub fn decode(gpa: std.mem.Allocator, text: []const u8) error{OutOfMemory}![]Stored { var out: std.ArrayList(Stored) = .empty; errdefer out.deinit(gpa); var i: usize = 0; -- cgit v1.3