diff options
author | Daniel Eades <danieleades@hotmail.com> | 2021-12-27 11:49:22 +0000 |
---|---|---|
committer | Daniel Eades <danieleades@hotmail.com> | 2021-12-29 12:54:40 +0000 |
commit | 00d95ccae26d2d0561c5a62a1ab5b3f842b70a92 (patch) | |
tree | c617909b68ed727e7b455dba05e4c520839bc5ed /src | |
parent | 278a899cddbd7150e54bd727fa7897e740376442 (diff) |
use implicit iter loops
Diffstat (limited to 'src')
-rw-r--r-- | src/builder.rs | 8 | ||||
-rw-r--r-- | src/config.rs | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/builder.rs b/src/builder.rs index f429ad4..5de7fe7 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -249,7 +249,7 @@ impl ConfigBuilder<DefaultState> { let mut cache: Value = Map::<String, Value>::new().into(); // Add defaults - for (key, val) in defaults.into_iter() { + for (key, val) in defaults { key.set(&mut cache, val); } @@ -257,7 +257,7 @@ impl ConfigBuilder<DefaultState> { sources.collect_to(&mut cache)?; // Add overrides - for (key, val) in overrides.into_iter() { + for (key, val) in overrides { key.set(&mut cache, val); } @@ -329,7 +329,7 @@ impl ConfigBuilder<AsyncState> { let mut cache: Value = Map::<String, Value>::new().into(); // Add defaults - for (key, val) in defaults.into_iter() { + for (key, val) in defaults { key.set(&mut cache, val); } @@ -341,7 +341,7 @@ impl ConfigBuilder<AsyncState> { } // Add overrides - for (key, val) in overrides.into_iter() { + for (key, val) in overrides { key.set(&mut cache, val); } diff --git a/src/config.rs b/src/config.rs index 8852506..e003daa 100644 --- a/src/config.rs +++ b/src/config.rs @@ -86,7 +86,7 @@ impl Config { let mut cache: Value = Map::<String, Value>::new().into(); // Add defaults - for (key, val) in self.defaults.iter() { + for (key, val) in &self.defaults { key.set(&mut cache, val.clone()); } @@ -94,7 +94,7 @@ impl Config { self.sources.collect_to(&mut cache)?; // Add overrides - for (key, val) in self.overrides.iter() { + for (key, val) in &self.overrides { key.set(&mut cache, val.clone()); } |