Skip to content

Commit

Permalink
more general solution as per Karl's comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve🔆 committed Nov 23, 2024
1 parent 93119c4 commit 3d47b08
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/router.zig
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,9 @@ pub fn Router(comptime Handler: type, comptime Action: type) type {
};
}

// Return a RouteConfig with the given dispatcher function embedded
pub fn registerDispatcher(_: Self, dispatcher: Dispatcher) RC {
return RC{
.dispatcher = dispatcher,
};
/// routeConfig allows the user to pass an anon struct, and have it coerced into the correct RC type for this router
pub fn routeConfig(_: Self, config: RC) RC {
return config;
}

pub fn get(self: *Self, path: []const u8, action: Action, config: RC) void {
Expand Down

0 comments on commit 3d47b08

Please sign in to comment.