From a331b2bf8b9c05ff0e1304ce44f65cda2cc0b077 Mon Sep 17 00:00:00 2001 From: Andy Weidenbaum Date: Wed, 17 Feb 2021 22:34:46 +1100 Subject: [PATCH] re-fmt comments --- src/searcher.rs | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/searcher.rs b/src/searcher.rs index 12ea994..19b2d9c 100644 --- a/src/searcher.rs +++ b/src/searcher.rs @@ -3,17 +3,14 @@ use std::collections::HashMap; use crate::types::Result; -/// Stores Lua modules indexed by module name, and provides an -/// `rlua::MetaMethod` to enable `require`ing the stored modules by name -/// in an `rlua::Context`. +/// Stores Lua modules indexed by module name, and provides an `rlua::MetaMethod` +/// to enable `require`ing the stored modules by name in an `rlua::Context`. struct Searcher { - /// A `HashMap` of Lua modules in `String` representation, indexed - /// by module name. + /// A `HashMap` of Lua modules in `String` representation, indexed by module name. modules: HashMap, - /// An `rlua::RegistryKey` whose value is the Lua environment within - /// which the user made the request to instantiate a `Searcher` for - /// `modules`. + /// An `rlua::RegistryKey` whose value is the Lua environment within which the + /// user made the request to instantiate a `Searcher` for `modules`. globals: RegistryKey, } @@ -40,8 +37,8 @@ impl UserData for Searcher { } } -/// Like `Searcher`, but with `modules` values encoded as `&'static str` -/// to facilitate compile-time includes of Fennel source code. +/// Like `Searcher`, but with `modules` values encoded as `&'static str` to facilitate +/// compile-time includes of Fennel source code. struct StaticSearcher { modules: HashMap<&'static str, &'static str>, globals: RegistryKey, @@ -73,12 +70,12 @@ impl UserData for StaticSearcher { /// 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. + /// `package.searchers` table in an `rlua::Context`, with lookup functionality + /// provided by the `rlua_searcher::Searcher` struct. fn add_searcher(&self, modules: HashMap) -> Result<()>; - /// Like `add_searcher`, but with Fennel source code encoded as - /// `&'static str` to facilitate compile-time includes. + /// Like `add_searcher`, but with Fennel source code encoded as `&'static str` + /// to facilitate compile-time includes. fn add_static_searcher(&self, modules: HashMap<&'static str, &'static str>) -> Result<()>; }