From 0849d05c83eb8f72cc4cf2834c80ab85f93bdff6 Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Sun, 31 May 2026 13:44:24 +0100 Subject: [PATCH] mlua_derive: Update docs --- docs/UserData.md | 6 +++--- docs/chunk.md | 2 +- docs/lua_module.md | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/UserData.md b/docs/UserData.md index 20bf167..f46f214 100644 --- a/docs/UserData.md +++ b/docs/UserData.md @@ -8,7 +8,7 @@ Named fields are exposed as readable and writable fields in Lua by default. Use `#[lua(...)]` on individual fields or methods to control how they are registered. -```rust +```rust,ignore use mlua::{Lua, Result, UserData}; #[derive(UserData)] @@ -92,7 +92,7 @@ At most one of `getter`, `setter`, `field` may be specified on a method. Constants in an `#[mlua::userdata_impl]` block are registered as static fields: -```rust +```rust,ignore #[mlua::userdata_impl] impl MyType { const VERSION: &str = "1.0"; @@ -108,7 +108,7 @@ Annotate a method with `#[lua(meta)]` to register it as a Lua metamethod. The metamethod name is inferred from the function name when it starts with `__`. Use `name = "..."` to specify the name explicitly. -```rust +```rust,ignore #[mlua::userdata_impl] impl MyType { #[lua(meta, infallible)] diff --git a/docs/chunk.md b/docs/chunk.md index 43c06ae..972048e 100644 --- a/docs/chunk.md +++ b/docs/chunk.md @@ -7,7 +7,7 @@ User's Rust types needs to implement [`UserData`] or [`IntoLua`] traits. Captured variables are **moved** into the chunk. -``` +```rust use mlua::{Lua, Result, chunk}; fn main() -> Result<()> { diff --git a/docs/lua_module.md b/docs/lua_module.md index 9156df9..5c5e84e 100644 --- a/docs/lua_module.md +++ b/docs/lua_module.md @@ -2,7 +2,7 @@ Registers Lua module entrypoint. You can register multiple entrypoints as required. -```ignore +```rust,ignore use mlua::{Lua, Result, Table}; #[mlua::lua_module] @@ -19,7 +19,7 @@ You can also pass options to the attribute: * name - name of the module, defaults to the name of the function -```ignore +```rust,ignore #[mlua::lua_module(name = "alt_module")] fn my_module(lua: &Lua) -> Result { ... @@ -33,7 +33,7 @@ limits or not. As a result, some operations that require memory allocation run i mode. Setting this attribute will improve performance of such operations with risk of having uncaught exceptions and memory leaks. -```ignore +```rust,ignore #[mlua::lua_module(skip_memory_check)] fn my_module(lua: &Lua) -> Result
{ ...