diff --git a/src/searcher.rs b/src/searcher.rs index ccda749..e415d12 100644 --- a/src/searcher.rs +++ b/src/searcher.rs @@ -25,7 +25,10 @@ impl Searcher { } impl UserData for Searcher { - fn add_methods<'lua, M: UserDataMethods<'lua, Self>>(methods: &mut M) { + fn add_methods<'lua, M>(methods: &mut M) + where + M: UserDataMethods<'lua, Self>, + { methods.add_meta_method(MetaMethod::Call, |lua_ctx, this, name: String| { match this.modules.get(&name) { Some(content) => Ok(Value::Function( @@ -55,7 +58,10 @@ impl StaticSearcher { } impl UserData for StaticSearcher { - fn add_methods<'lua, M: UserDataMethods<'lua, Self>>(methods: &mut M) { + fn add_methods<'lua, M>(methods: &mut M) + where + M: UserDataMethods<'lua, Self>, + { methods.add_meta_method(MetaMethod::Call, |lua_ctx, this, name: String| { match this.modules.get(name.as_str()) { Some(content) => Ok(Value::Function( @@ -108,7 +114,10 @@ impl
UserData for PathSearcherPoly
where
P: 'static + AsRef