Conversation
|
Looks pretty good imo, thanks for the work! (I'm also kinda interested in how copilot reviews work, so Imma just request a review from copilot rq, first time trying it) |
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the Lua API integration by moving the log, server, and events tables into their own structs implementing mlua::UserData for better separation of concerns.
- Introduces separate Lua userdata structs for log, server, and events
- Updates the runtime to reference these new structs instead of inlined function definitions
- Adjusts module exports accordingly in the lua module
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/lua/structs/server.rs | Implements the Server userdata with an async function |
| src/lua/structs/log.rs | Implements the Log userdata with logging functions |
| src/lua/structs/events.rs | Implements the Events userdata with listener management |
| src/lua/runtime.rs | Updates pumpkin global to use new structs and events setup |
| src/lua/structs/mod.rs | Exposes new structs through the module |
| src/lua/mod.rs | Registers the structs module |
| })?, | ||
| )?; | ||
|
|
||
| events_table.set("", structs::Events)?; |
There was a problem hiding this comment.
The events table is being set using an empty key, which is likely unintended. Consider using a meaningful key (e.g., "events") or verifying this is the intended behavior.
| events_table.set("", structs::Events)?; | |
| events_table.set("default", structs::Events)?; |
|
Well, interesting result, but I'm gonna merge it anyway. Thanks again for the work! |
Description
Moved
log,serverandeventslua tables into structs implementingmlua::UserData