camelCase for function names
This commit is contained in:
@@ -13,20 +13,20 @@ pub const Request = union(enum) {
|
||||
};
|
||||
|
||||
const Self = @This();
|
||||
pub fn from_function(comptime function: anytype, alloc: std.mem.Allocator) !Self {
|
||||
utils.validate_system(function);
|
||||
pub fn fromFunction(comptime function: anytype, alloc: std.mem.Allocator) !Self {
|
||||
utils.validateSystem(function);
|
||||
|
||||
var requests: [@typeInfo(@TypeOf(function)).Fn.params.len]Request = undefined;
|
||||
inline for (0.., @typeInfo(@TypeOf(function)).Fn.params) |i, param| {
|
||||
switch (@typeInfo(param.type.?).Pointer.child) {
|
||||
var requests: [@typeInfo(@TypeOf(function)).@"fn".params.len]Request = undefined;
|
||||
inline for (0.., @typeInfo(@TypeOf(function)).@"fn".params) |i, param| {
|
||||
switch (@typeInfo(param.type.?).pointer.child) {
|
||||
Controller => requests[i] = .controller,
|
||||
else => |resource_type| requests[i] = .{ .resource = utils.hash_type(resource_type) },
|
||||
else => |resource_type| requests[i] = .{ .resource = utils.hashType(resource_type) },
|
||||
}
|
||||
}
|
||||
|
||||
return Self{
|
||||
.requested_types = try alloc.dupe(Request, &requests),
|
||||
.function_runner = utils.generate_runner(function),
|
||||
.function_runner = utils.generateRunner(function),
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user