diff --git a/src/check.rs b/src/check.rs index 4ede106..96ed274 100644 --- a/src/check.rs +++ b/src/check.rs @@ -23,6 +23,20 @@ pub enum PlayerCheck { Err(Vec), } +/// 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);