diff --git a/crates/luaffi_impl/src/metatype.rs b/crates/luaffi_impl/src/metatype.rs index 125e87c..7959d84 100644 --- a/crates/luaffi_impl/src/metatype.rs +++ b/crates/luaffi_impl/src/metatype.rs @@ -821,28 +821,31 @@ fn document_async(func: &mut ImplItemFn) { fn document_metamethod(func: &mut ImplItemFn, method: Metamethod) { let s = match method { - Metamethod::Eq => "This is a metamethod which is called by the `==` operator.".into(), - Metamethod::Len => "This is a metamethod which is called by the `#` operator.".into(), - Metamethod::Lt => "This is a metamethod which is called by the `<` operator.".into(), - Metamethod::Le => "This is a metamethod which is called by the `<=` operator.".into(), - Metamethod::Concat => "This is a metamethod which is called by the `..` operator.".into(), - Metamethod::Add => "This is a metamethod which is called by the `+` operator.".into(), - Metamethod::Sub => "This is a metamethod which is called by the `-` operator.".into(), - Metamethod::Mul => "This is a metamethod which is called by the `*` operator.".into(), - Metamethod::Div => "This is a metamethod which is called by the `/` operator.".into(), - Metamethod::Mod => "This is a metamethod which is called by the `%` operator.".into(), - Metamethod::Pow => "This is a metamethod which is called by the `^` operator.".into(), - Metamethod::Unm => "This is a metamethod which is called by the `-` operator.".into(), + Metamethod::Eq => "This is a metamethod which is called by the `==` operator.", + Metamethod::Len => "This is a metamethod which is called by the `#` operator.", + Metamethod::Lt => "This is a metamethod which is called by the `<` operator.", + Metamethod::Le => "This is a metamethod which is called by the `<=` operator.", + Metamethod::Concat => "This is a metamethod which is called by the `..` operator.", + Metamethod::Call => { + "This is a metamethod which can be called by calling `(...)` on the value directly." + } + Metamethod::Add => "This is a metamethod which is called by the `+` operator.", + Metamethod::Sub => "This is a metamethod which is called by the `-` operator.", + Metamethod::Mul => "This is a metamethod which is called by the `*` operator.", + Metamethod::Div => "This is a metamethod which is called by the `/` operator.", + Metamethod::Mod => "This is a metamethod which is called by the `%` operator.", + Metamethod::Pow => "This is a metamethod which is called by the `^` operator.", + Metamethod::Unm => "This is a metamethod which is called by the `-` operator.", Metamethod::ToString => { - "This is a metamethod which can be called by the `tostring` built-in function.".into() + "This is a metamethod which is called by the [`tostring(...)`](https://www.lua.org/manual/5.1/manual.html#pdf-tostring) built-in function." } Metamethod::Pairs => { - "This is a metamethod which can be called by the `pairs` built-in function.".into() + "This is a metamethod which is called by the [`pairs(...)`](https://www.lua.org/manual/5.1/manual.html#pdf-pairs) built-in function." } Metamethod::Ipairs => { - "This is a metamethod which can be called by the `ipairs` built-in function.".into() + "This is a metamethod which is called by the [`ipairs(...)`](https://www.lua.org/manual/5.1/manual.html#pdf-ipairs) built-in function." } - _ => format!("This is a metamethod and cannot be called directly."), + _ => "This is a metamethod and cannot be called directly.", }; func.attrs.insert(0, parse_quote!(#[doc =