const std = @import("std"); // Returns an array of all the fields in the given // type replacing all '_' with '-'. pub fn RPCFields(comptime E: type) []const []const u8 { @setEvalBranchQuota(10000); var names: []const []const u8 = &[_][]const u8{}; for (std.meta.fields(E)) |field| { var name: [field.name.len]u8 = undefined; _ = std.mem.replace(u8, field.name, &[_]u8{'_'}, &[_]u8{'-'}, &name); names = names ++ &[_][]const u8{&name}; } return names; }