Skip to content

Commit cbb52d7

Browse files
Merge pull request #181 from matthiasbeyer/set-doc
Documentation for `Config::set*()`
2 parents 975d715 + 7d17f91 commit cbb52d7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/config.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ impl Config {
139139
Ok(self)
140140
}
141141

142+
/// Set a default `value` at `key`
142143
pub fn set_default<T>(&mut self, key: &str, value: T) -> Result<&mut Config>
143144
where
144145
T: Into<Value>,
@@ -156,6 +157,14 @@ impl Config {
156157
self.refresh()
157158
}
158159

160+
/// Set an overwrite
161+
///
162+
/// This function sets an overwrite value.
163+
/// The overwrite `value` is written to the `key` location on every `refresh()`
164+
///
165+
/// # Warning
166+
///
167+
/// Errors if config is frozen
159168
pub fn set<T>(&mut self, key: &str, value: T) -> Result<&mut Config>
160169
where
161170
T: Into<Value>,

0 commit comments

Comments
 (0)