1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-26 14:17:45 +00:00

Improve CFG documentation

This commit is contained in:
Joshua Goins 2023-12-02 20:01:39 -05:00
parent 2ded1ac2a0
commit 2f29b8eeae

View file

@ -78,6 +78,7 @@ impl ConfigFile {
Some(buffer)
}
/// Checks if the CFG contains a key named `select_key`
pub fn has_key(&self, select_key: &str) -> bool {
for (_, keys) in &self.settings {
for (key, _) in &keys.keys {
@ -90,6 +91,7 @@ impl ConfigFile {
false
}
/// Checks if the CFG contains a category named `select_category`
pub fn has_category(&self, select_category: &str) -> bool {
for (category, _) in &self.settings {
if select_category == category {
@ -100,6 +102,7 @@ impl ConfigFile {
false
}
/// Sets the value to `new_value` of `select_key`
pub fn set_value(&mut self, select_key: &str, new_value: &str) {
for (_, keys) in &mut self.settings {
for (key, value) in &mut keys.keys {