mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
Rename LuaTable::(raw_)length to (raw_)len
All Rust containers use `len` for this. Even in the Lua API, this is called `lua_len` and `lua_rawlen`.
This commit is contained in:
+2
-2
@@ -285,7 +285,7 @@ impl<'lua> LuaTable<'lua> {
|
||||
///
|
||||
/// This might invoke the `__len` metamethod. Use the `raw_length` method if that is not
|
||||
/// desired.
|
||||
pub fn length(&self) -> LuaResult<LuaInteger> {
|
||||
pub fn len(&self) -> LuaResult<LuaInteger> {
|
||||
let lua = self.0.lua;
|
||||
unsafe {
|
||||
error_guard(lua.state, 0, 0, |state| {
|
||||
@@ -298,7 +298,7 @@ impl<'lua> LuaTable<'lua> {
|
||||
|
||||
/// Returns the result of the Lua `#` operator, without invoking the
|
||||
/// `__len` metamethod.
|
||||
pub fn raw_length(&self) -> LuaResult<LuaInteger> {
|
||||
pub fn raw_len(&self) -> LuaResult<LuaInteger> {
|
||||
let lua = self.0.lua;
|
||||
unsafe {
|
||||
stack_guard(lua.state, 0, || {
|
||||
|
||||
Reference in New Issue
Block a user