From aaa0f160d5820e2c15dbe159923b05f95c7b3fad Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 17 Oct 2024 14:14:42 -0700 Subject: [PATCH] rename ClassFunctions -> ClassMethodsStore --- src/runner/instance.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/runner/instance.rs b/src/runner/instance.rs index 59b697d..a2e3023 100644 --- a/src/runner/instance.rs +++ b/src/runner/instance.rs @@ -8,7 +8,7 @@ use super::vector3::Vector3; pub fn set_globals(lua:&mlua::Lua,globals:&mlua::Table)->Result<(),mlua::Error>{ //class functions store - lua.set_app_data(ClassFunctions::default()); + lua.set_app_data(ClassMethodsStore::default()); let instance_table=lua.create_table()?; @@ -34,8 +34,8 @@ fn dom_mut(lua:&mlua::Lua,mut f:impl FnMut(&mut WeakDom)->mlua::Result)->m let mut dom=lua.app_data_mut::<&'static mut WeakDom>().ok_or(mlua::Error::runtime("DataModel missing"))?; f(&mut *dom) } -fn class_functions_mut(lua:&mlua::Lua,mut f:impl FnMut(&mut ClassFunctions)->mlua::Result)->mlua::Result{ - let mut cf=lua.app_data_mut::().ok_or(mlua::Error::runtime("ClassFunctions missing"))?; +fn class_functions_mut(lua:&mlua::Lua,mut f:impl FnMut(&mut ClassMethodsStore)->mlua::Result)->mlua::Result{ + let mut cf=lua.app_data_mut::().ok_or(mlua::Error::runtime("ClassFunctions missing"))?; f(&mut *cf) } @@ -392,14 +392,14 @@ static CLASS_FUNCTION_DATABASE:CFD=phf::phf_map!{ /// A store of created functions for each Roblox class. /// Functions are created the first time they are accessed and stored in this data structure. #[derive(Default)] -struct ClassFunctions{ +struct ClassMethodsStore{ classes:HashMap<&'static str,//ClassName HashMap<&'static str,//Method name mlua::Function > > } -impl ClassFunctions{ +impl ClassMethodsStore{ /// return self.classes[class] or create the ClassMethods and then return it fn get_or_create_class_methods(&mut self,class:&str)->Option{ // Use get_entry to get the &'static str keys of the database