From 39bb83c97b6769cee6225cbd04e33ea95d0a8b64 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 21 Aug 2021 11:02:56 +0200 Subject: Add CI job for checking examples Signed-off-by: Matthias Beyer --- .github/workflows/msrv.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index 3ec7270..95f1e0a 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -137,3 +137,30 @@ jobs: with: command: clippy args: -- -D warnings + + check-examples: + name: Check examples + needs: [check] + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - 1.46.0 + - stable + + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + override: true + + - name: Run cargo check + uses: actions-rs/cargo@v1 + with: + command: check + args: --examples + -- cgit v1.2.3 From 63fc25b251e9f01baaf3546830393e4441888a58 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 21 Aug 2021 11:00:02 +0200 Subject: Fix: Import HashMap instead of Map I didn't catch that when merging PR #217. CI should have catched it, but we actually never ran CI for examples. Signed-off-by: Matthias Beyer Fixes: be82af2 ("Rename MapImpl to Map") Fixes: 0d3a5c3 ("Merge pull request #217 from dlo9/master") --- examples/glob/src/main.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/glob/src/main.rs b/examples/glob/src/main.rs index 002ddd4..b3183ef 100644 --- a/examples/glob/src/main.rs +++ b/examples/glob/src/main.rs @@ -1,5 +1,5 @@ use std::path::Path; -use std::collections::Map; +use std::collections::HashMap; use config::*; use glob::glob; @@ -14,9 +14,9 @@ fn main() { .merge(File::from(Path::new("conf/05-some.yml"))).unwrap() .merge(File::from(Path::new("conf/99-extra.json"))).unwrap(); - // Print out our settings (as a Map) + // Print out our settings (as a HashMap) println!("\n{:?} \n\n-----------", - settings.try_into::>().unwrap()); + settings.try_into::>().unwrap()); // Option 2 // -------- @@ -28,9 +28,9 @@ fn main() { File::from(Path::new("conf/99-extra.json"))]) .unwrap(); - // Print out our settings (as a Map) + // Print out our settings (as a HashMap) println!("\n{:?} \n\n-----------", - settings.try_into::>().unwrap()); + settings.try_into::>().unwrap()); // Option 3 // -------- @@ -43,7 +43,7 @@ fn main() { .collect::>()) .unwrap(); - // Print out our settings (as a Map) + // Print out our settings (as a HashMap) println!("\n{:?} \n\n-----------", - settings.try_into::>().unwrap()); + settings.try_into::>().unwrap()); } -- cgit v1.2.3 From 30c2c0e3acfa0470299a1abe56ff807a204f38b2 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 21 Aug 2021 11:00:02 +0200 Subject: Fix: Import HashMap instead of Map I didn't catch that when merging PR #217. Fixes: be82af2 ("Rename MapImpl to Map") Fixes: 0d3a5c3 ("Merge pull request #217 from dlo9/master") Signed-off-by: Matthias Beyer --- examples/simple/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/simple/src/main.rs b/examples/simple/src/main.rs index e07eff2..1c7ddb7 100644 --- a/examples/simple/src/main.rs +++ b/examples/simple/src/main.rs @@ -1,4 +1,4 @@ -use std::collections::Map; +use std::collections::HashMap; fn main() { let mut settings = config::Config::default(); @@ -9,7 +9,7 @@ fn main() { // Eg.. `APP_DEBUG=1 ./target/app` would set the `debug` key .merge(config::Environment::with_prefix("APP")).unwrap(); - // Print out our settings (as a Map) + // Print out our settings (as a HashMap) println!("{:?}", - settings.try_into::>().unwrap()); + settings.try_into::>().unwrap()); } -- cgit v1.2.3 From 22281f1c331e139c2ca6afc3ab27b22fac851a4c Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 21 Aug 2021 11:00:02 +0200 Subject: Fix: Import HashMap instead of Map I didn't catch that when merging PR #217. Fixes: be82af2 ("Rename MapImpl to Map") Fixes: 0d3a5c3 ("Merge pull request #217 from dlo9/master") Signed-off-by: Matthias Beyer --- examples/watch/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/watch/src/main.rs b/examples/watch/src/main.rs index cbe30e7..a197390 100644 --- a/examples/watch/src/main.rs +++ b/examples/watch/src/main.rs @@ -1,5 +1,5 @@ use config::*; -use std::collections::Map; +use std::collections::HashMap; use std::sync::RwLock; use notify::{RecommendedWatcher, DebouncedEvent, Watcher, RecursiveMode}; use std::sync::mpsc::channel; @@ -20,7 +20,7 @@ fn show() { .read() .unwrap() .clone() - .try_into::>() + .try_into::>() .unwrap()); } -- cgit v1.2.3