From d431c0f1332e67c456bab4df8a11f6fd2c7d8bbc Mon Sep 17 00:00:00 2001 From: rasul Date: Thu, 30 Apr 2020 21:14:03 -0500 Subject: [PATCH] add some doc for init() --- src/check.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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);