From 8b065a0626899b519bd22438e86d47a71baef319 Mon Sep 17 00:00:00 2001 From: ramiroaisen <52116153+ramiroaisen@users.noreply.github.com> Date: Sat, 6 Jul 2024 20:33:04 -0300 Subject: [PATCH 1/2] core: improve doc examples --- README.md | 2 +- metre/src/lib.rs | 2 +- metre/tests/tests.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2c00ecb..7d6341d 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,9 @@ struct MyConfig { let mut loader = ConfigLoader::::new(); +loader.defaults()?; loader.file("config.json", Format::Json)?; loader.env()?; -loader.defaults()?; // config have the type MyConfig here let config = loader.finish()?; diff --git a/metre/src/lib.rs b/metre/src/lib.rs index 45664e3..25bc192 100644 --- a/metre/src/lib.rs +++ b/metre/src/lib.rs @@ -41,9 +41,9 @@ //! //! let mut loader = ConfigLoader::::new(); //! +//! loader.defaults()?; //! loader.file("config.json", Format::Json)?; //! loader.env()?; -//! loader.defaults()?; //! //! // config have the type MyConfig here, or loader.finish() returns an error //! let config = loader.finish()?; diff --git a/metre/tests/tests.rs b/metre/tests/tests.rs index b2bbf16..8dc80a9 100644 --- a/metre/tests/tests.rs +++ b/metre/tests/tests.rs @@ -18,9 +18,9 @@ fn readme_example() -> Result<(), Box> { let mut loader = ConfigLoader::::new(); + loader.defaults()?; loader.file("config.json", Format::Json)?; loader.env()?; - loader.defaults()?; // config have the type MyConfig here, or loader.finish() returns an error let config = loader.finish()?; From 59ae340b1114dfea17f25985e04040a3fc1bbbc0 Mon Sep 17 00:00:00 2001 From: ramiroaisen <52116153+ramiroaisen@users.noreply.github.com> Date: Sat, 6 Jul 2024 20:34:30 -0300 Subject: [PATCH 2/2] core: bump version --- Cargo.lock | 4 ++-- metre-macros/Cargo.toml | 2 +- metre/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 370f557..e9a3903 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -513,7 +513,7 @@ checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "metre" -version = "0.2.3" +version = "0.2.4" dependencies = [ "json_comments", "metre-macros", @@ -528,7 +528,7 @@ dependencies = [ [[package]] name = "metre-macros" -version = "0.2.3" +version = "0.2.4" dependencies = [ "Inflector", "darling", diff --git a/metre-macros/Cargo.toml b/metre-macros/Cargo.toml index e3c3b17..70c1c0e 100644 --- a/metre-macros/Cargo.toml +++ b/metre-macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "metre-macros" -version = "0.2.3" +version = "0.2.4" edition = "2021" license = "Apache-2.0" description = "Macros for the metre crate" diff --git a/metre/Cargo.toml b/metre/Cargo.toml index f7761c2..cc52449 100644 --- a/metre/Cargo.toml +++ b/metre/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "metre" -version = "0.2.3" +version = "0.2.4" edition = "2021" description = "Metre, the configuration loader for Rust" repository = "https://github.com/ramiroaisen/metre"