Uniformize calling name conventions

Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
Francis Bouvier
2024-06-19 15:56:44 +02:00
parent 0f8b47b598
commit aca64eedca
9 changed files with 38 additions and 39 deletions

View File

@@ -6,7 +6,7 @@ const cdp = @import("cdp.zig");
const result = cdp.result;
const getMsg = cdp.getMsg;
const PerformanceMethods = enum {
const Methods = enum {
enable,
};
@@ -17,15 +17,15 @@ pub fn performance(
scanner: *std.json.Scanner,
ctx: *Ctx,
) ![]const u8 {
const method = std.meta.stringToEnum(PerformanceMethods, action) orelse
const method = std.meta.stringToEnum(Methods, action) orelse
return error.UnknownMethod;
return switch (method) {
.enable => performanceEnable(alloc, id, scanner, ctx),
.enable => enable(alloc, id, scanner, ctx),
};
}
fn performanceEnable(
fn enable(
alloc: std.mem.Allocator,
id: ?u16,
scanner: *std.json.Scanner,