re-fmt comments

This commit is contained in:
Andy Weidenbaum 2021-02-17 22:34:46 +11:00
parent 8c8bd29d0d
commit a331b2bf8b

View File

@ -3,17 +3,14 @@ use std::collections::HashMap;
use crate::types::Result; use crate::types::Result;
/// Stores Lua modules indexed by module name, and provides an /// Stores Lua modules indexed by module name, and provides an `rlua::MetaMethod`
/// `rlua::MetaMethod` to enable `require`ing the stored modules by name /// to enable `require`ing the stored modules by name in an `rlua::Context`.
/// in an `rlua::Context`.
struct Searcher { struct Searcher {
/// A `HashMap` of Lua modules in `String` representation, indexed /// A `HashMap` of Lua modules in `String` representation, indexed by module name.
/// by module name.
modules: HashMap<String, String>, modules: HashMap<String, String>,
/// An `rlua::RegistryKey` whose value is the Lua environment within /// An `rlua::RegistryKey` whose value is the Lua environment within which the
/// which the user made the request to instantiate a `Searcher` for /// user made the request to instantiate a `Searcher` for `modules`.
/// `modules`.
globals: RegistryKey, globals: RegistryKey,
} }
@ -40,8 +37,8 @@ impl UserData for Searcher {
} }
} }
/// Like `Searcher`, but with `modules` values encoded as `&'static str` /// Like `Searcher`, but with `modules` values encoded as `&'static str` to facilitate
/// to facilitate compile-time includes of Fennel source code. /// compile-time includes of Fennel source code.
struct StaticSearcher { struct StaticSearcher {
modules: HashMap<&'static str, &'static str>, modules: HashMap<&'static str, &'static str>,
globals: RegistryKey, globals: RegistryKey,
@ -73,12 +70,12 @@ impl UserData for StaticSearcher {
/// Extend `rlua::Context` to support `require`ing Lua modules by name. /// Extend `rlua::Context` to support `require`ing Lua modules by name.
pub trait AddSearcher { pub trait AddSearcher {
/// Add a `HashMap` of Lua modules indexed by module name to Luas /// Add a `HashMap` of Lua modules indexed by module name to Luas
/// `package.searchers` table in an `rlua::Context`, with lookup /// `package.searchers` table in an `rlua::Context`, with lookup functionality
/// functionality provided by the `rlua_searcher::Searcher` struct. /// provided by the `rlua_searcher::Searcher` struct.
fn add_searcher(&self, modules: HashMap<String, String>) -> Result<()>; fn add_searcher(&self, modules: HashMap<String, String>) -> Result<()>;
/// Like `add_searcher`, but with Fennel source code encoded as /// Like `add_searcher`, but with Fennel source code encoded as `&'static str`
/// `&'static str` to facilitate compile-time includes. /// to facilitate compile-time includes.
fn add_static_searcher(&self, modules: HashMap<&'static str, &'static str>) -> Result<()>; fn add_static_searcher(&self, modules: HashMap<&'static str, &'static str>) -> Result<()>;
} }