Commit

Author:

Hash:

Timestamp:

+2 -2 +/-2 browse

Kevin Schoon [me@kevinschoon.com]

b17728a7a40cfffc7dd4aef252bbfff11306d2de

Tue, 06 Feb 2024 21:31:45 +0000 (1.4 years ago)

change from_str -> read in config loader
1diff --git a/crates/config/src/reader.rs b/crates/config/src/reader.rs
2index b1e8f6f..abb4889 100644
3--- a/crates/config/src/reader.rs
4+++ b/crates/config/src/reader.rs
5 @@ -68,7 +68,7 @@ where
6 }
7
8 /// load the config from a string
9- pub fn from_str(config_str: &str) -> Result<T, Error> {
10+ pub fn read(config_str: &str) -> Result<T, Error> {
11 let mut config = from_str::<T>(config_str)?;
12 config.initialize()?;
13 config.validate()?;
14 diff --git a/src/config.rs b/src/config.rs
15index 251642e..a00c5cf 100644
16--- a/src/config.rs
17+++ b/src/config.rs
18 @@ -378,6 +378,6 @@ mod tests {
19
20 #[test]
21 fn test_example_config() {
22- Reader::<Config>::from_str(EXAMPLE_CONFIG).unwrap();
23+ Reader::<Config>::read(EXAMPLE_CONFIG).unwrap();
24 }
25 }