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