diff --git a/src/searcher.rs b/src/searcher.rs index 5ac5013..42d6813 100644 --- a/src/searcher.rs +++ b/src/searcher.rs @@ -123,13 +123,13 @@ pub struct ClosureSearcher { /// /// 1. An `rlua::Context`, which the closure can do what it wants with. /// - /// 2. An `rlua::Table` containing globals (i.e. Lua's `_G`), which can be passed - /// to `Chunk.set_environment()`. + /// 2. An `rlua::Table` containing globals (i.e. Lua's `_G`), which can be passed to + /// `Chunk.set_environment()`. /// /// 3. The name of the module to be loaded (`&str`). /// - /// Closures must return an `rlua::Result`-wrapped `Function`. This `Function` - /// acts as the module loader. + /// Closures must return an `rlua::Result`-wrapped `Function`. This `Function` acts as + /// the module loader. modules: HashMap< Cow<'static, str>, Box< @@ -178,8 +178,8 @@ impl UserData for ClosureSearcher { } } -/// Like `Searcher`, but with function pointers as `modules` values, to facilitate -/// setting up an `rlua::Context` with Rust code. +/// Like `Searcher`, but with function pointers as `modules` values, to facilitate setting +/// up an `rlua::Context` with Rust code. /// /// Enables exposing `UserData` types to an `rlua::Context`. pub struct FunctionSearcher { @@ -187,13 +187,13 @@ pub struct FunctionSearcher { /// /// 1. An `rlua::Context`, which the function body can do what it wants with. /// - /// 2. An `rlua::Table` containing globals (i.e. Lua's `_G`), which can be passed - /// to `Chunk.set_environment()`. + /// 2. An `rlua::Table` containing globals (i.e. Lua's `_G`), which can be passed to + /// `Chunk.set_environment()`. /// /// 3. The name of the module to be loaded (`&str`). /// - /// Functions must return an `rlua::Result`-wrapped `Function`. This `Function` - /// acts as the module loader. + /// Functions must return an `rlua::Result`-wrapped `Function`. This `Function` acts + /// as the module loader. modules: HashMap< Cow<'static, str>, for<'ctx> fn(Context<'ctx>, Table<'ctx>, &str) -> rlua::Result>, @@ -238,9 +238,9 @@ impl UserData for FunctionSearcher { /// Extend `rlua::Context` to support `require`ing Lua modules by name. pub trait AddSearcher { - /// Add a `HashMap` of Lua modules indexed by module name to Lua's - /// `package.searchers` table in an `rlua::Context`, with lookup functionality - /// provided by the `rlua_searcher::Searcher` struct. + /// Add a `HashMap` of Lua modules indexed by module name to Lua's `package.searchers` + /// table in an `rlua::Context`, with lookup functionality provided by the + /// `rlua_searcher::Searcher` struct. fn add_searcher(&self, modules: HashMap, Cow<'static, str>>) -> Result<()>; /// Like `add_searcher`, but with `modules` values given as paths to files containing @@ -249,8 +249,8 @@ pub trait AddSearcher { where P: 'static + AsRef + Send; - /// Like `add_path_searcher`, but with user-provided closure for transforming - /// source code to Lua. + /// Like `add_path_searcher`, but with user-provided closure for transforming source + /// code to Lua. fn add_path_searcher_poly

( &self, modules: HashMap, P>,