diff --git a/src/table.rs b/src/table.rs index 3585853..8227d6a 100644 --- a/src/table.rs +++ b/src/table.rs @@ -132,6 +132,13 @@ impl<'lua> Table<'lua> { } } + /// Removes a key from the table, returning the value at the key + /// if the key was previously in the table. + pub fn raw_remove>(&self, key: K) -> Result<()> { + self.raw_set(key, Nil)?; + Ok(()) + } + /// Sets a key-value pair without invoking metamethods. pub fn raw_set, V: ToLua<'lua>>(&self, key: K, value: V) -> Result<()> { let lua = self.0.lua;