From efd26fd3bb57959cf281053208a9584fd452dcac Mon Sep 17 00:00:00 2001 From: renerocksai Date: Thu, 27 Mar 2025 01:12:40 +0100 Subject: [PATCH] app cosmetics --- src/App.zig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/App.zig b/src/App.zig index 1fd67da..ac55f30 100644 --- a/src/App.zig +++ b/src/App.zig @@ -55,24 +55,24 @@ pub fn Create(comptime Context: type) type { pub fn Wrap(T: type) type { return struct { wrapped: *T, - wrapper: Interface, + interface: Interface, opts: Opts, app_context: *Context, const Wrapped = @This(); - pub fn unwrap(wrapper: *Interface) *Wrapped { - const self: *Wrapped = @alignCast(@fieldParentPtr("wrapper", wrapper)); + pub fn unwrap(interface: *Interface) *Wrapped { + const self: *Wrapped = @alignCast(@fieldParentPtr("interface", interface)); return self; } pub fn destroy(allocator: Allocator, wrapper: *Interface) void { - const self: *Wrapped = @alignCast(@fieldParentPtr("wrapper", wrapper)); + const self: *Wrapped = @alignCast(@fieldParentPtr("interface", wrapper)); allocator.destroy(self); } - pub fn onRequestWrapped(wrapper: *Interface, r: zap.Request) !void { - var self: *Wrapped = Wrapped.unwrap(wrapper); + pub fn onRequestWrapped(interface: *Interface, r: zap.Request) !void { + var self: *Wrapped = Wrapped.unwrap(interface); const arena = try get_arena(); try self.onRequest(arena.allocator(), self.app_context, r); arena.reset(.{ .retain_capacity = self.opts.arena_retain_capacity });