summaryrefslogtreecommitdiffstats
path: root/src/config.rs
diff options
context:
space:
mode:
authorDaniel Eades <danieleades@hotmail.com>2022-01-29 12:14:37 +0100
committerDaniel Eades <danieleades@hotmail.com>2022-01-29 14:01:49 +0100
commit6ecfeec624ae9e145b66431188bae31c17bcd154 (patch)
tree82a552f664dd98c5e55007aff914632834810e33 /src/config.rs
parent53e43fbcf96b5c2a661d052a6e3d55fc3709f1e1 (diff)
use 'Self' to refer to own type
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/config.rs b/src/config.rs
index e003daa..27b318d 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -26,7 +26,7 @@ pub struct Config {
impl Default for Config {
fn default() -> Self {
- Config {
+ Self {
defaults: Default::default(),
overrides: Default::default(),
sources: Default::default(),
@@ -37,9 +37,9 @@ impl Default for Config {
impl Config {
pub(crate) fn new(value: Value) -> Self {
- Config {
+ Self {
cache: value,
- ..Default::default()
+ ..Self::default()
}
}
@@ -50,7 +50,7 @@ impl Config {
/// Merge in a configuration property source.
#[deprecated(since = "0.12.0", note = "please use 'ConfigBuilder' instead")]
- pub fn merge<T>(&mut self, source: T) -> Result<&mut Config>
+ pub fn merge<T>(&mut self, source: T) -> Result<&mut Self>
where
T: 'static,
T: Source + Send + Sync,
@@ -81,7 +81,7 @@ impl Config {
/// Configuration is automatically refreshed after a mutation
/// operation (`set`, `merge`, `set_default`, etc.).
#[deprecated(since = "0.12.0", note = "please use 'ConfigBuilder' instead")]
- pub fn refresh(&mut self) -> Result<&mut Config> {
+ pub fn refresh(&mut self) -> Result<&mut Self> {
self.cache = {
let mut cache: Value = Map::<String, Value>::new().into();
@@ -106,7 +106,7 @@ impl Config {
/// Set a default `value` at `key`
#[deprecated(since = "0.12.0", note = "please use 'ConfigBuilder' instead")]
- pub fn set_default<T>(&mut self, key: &str, value: T) -> Result<&mut Config>
+ pub fn set_default<T>(&mut self, key: &str, value: T) -> Result<&mut Self>
where
T: Into<Value>,
{
@@ -125,7 +125,7 @@ impl Config {
///
/// Errors if config is frozen
#[deprecated(since = "0.12.0", note = "please use 'ConfigBuilder' instead")]
- pub fn set<T>(&mut self, key: &str, value: T) -> Result<&mut Config>
+ pub fn set<T>(&mut self, key: &str, value: T) -> Result<&mut Self>
where
T: Into<Value>,
{