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:
Jonas Schievink
2017-06-18 14:36:30 +02:00
parent de0f3dc3c0
commit ed210e88b5
3 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -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, || {