Rename LuaTable::has to contains_key

This is what all Rust maps use
This commit is contained in:
Jonas Schievink
2017-06-18 14:39:18 +02:00
parent ed210e88b5
commit a47a6e32ef
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -233,7 +233,7 @@ impl<'lua> LuaTable<'lua> {
}
/// Checks whether the table contains a non-nil value for `key`.
pub fn has<K: ToLua<'lua>>(&self, key: K) -> LuaResult<bool> {
pub fn contains_key<K: ToLua<'lua>>(&self, key: K) -> LuaResult<bool> {
let lua = self.0.lua;
let key = key.to_lua(lua)?;
unsafe {
+1 -1
View File
@@ -40,7 +40,7 @@ fn test_load() {
"#,
None,
).unwrap();
assert!(module.has("func").unwrap());
assert!(module.contains_key("func").unwrap());
assert_eq!(
module
.get::<_, LuaFunction>("func")