add some doc for init()

master
rasul 5 years ago
parent 6a1df72b2a
commit d431c0f133

@ -23,6 +23,20 @@ pub enum PlayerCheck {
Err(Vec<String>),
}
/// Initialize the check module from the Player part of the Config.
///
/// # Arguments
///
/// * config: the Player struct of Config
///
/// # Example
/// ```
/// use rude::config::Config;
/// use rude::check;
///
/// let config = Config::load("config.toml").unwrap();
/// check::init(&config.player);
/// ```
pub fn init(config: &Player) {
NAME_MIN.with(|n| *n.borrow_mut() = config.name_min);
NAME_MAX.with(|n| *n.borrow_mut() = config.name_max);

Loading…
Cancel
Save