diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-08-21 11:23:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-21 11:23:16 +0200 |
commit | 3f179990e1cca46f9b3d82e676a4a01d5314052e (patch) | |
tree | 7ee89d3f32d9a17c31f1966ddd0e55b4300eea18 | |
parent | 0d3a5c3d24a77467366a8d10df439f511dde4dd6 (diff) | |
parent | 22281f1c331e139c2ca6afc3ab27b22fac851a4c (diff) |
Merge pull request #222 from matthiasbeyer/fix-221
Make sure examples build
-rw-r--r-- | .github/workflows/msrv.yml | 27 | ||||
-rw-r--r-- | examples/glob/src/main.rs | 14 | ||||
-rw-r--r-- | examples/simple/src/main.rs | 6 | ||||
-rw-r--r-- | examples/watch/src/main.rs | 4 |
4 files changed, 39 insertions, 12 deletions
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 + 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::<Map<String, String>>().unwrap()); + settings.try_into::<HashMap<String, String>>().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::<Map<String, String>>().unwrap()); + settings.try_into::<HashMap<String, String>>().unwrap()); // Option 3 // -------- @@ -43,7 +43,7 @@ fn main() { .collect::<Vec<_>>()) .unwrap(); - // Print out our settings (as a Map) + // Print out our settings (as a HashMap) println!("\n{:?} \n\n-----------", - settings.try_into::<Map<String, String>>().unwrap()); + settings.try_into::<HashMap<String, String>>().unwrap()); } 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::<Map<String, String>>().unwrap()); + settings.try_into::<HashMap<String, String>>().unwrap()); } 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::<Map<String, String>>() + .try_into::<HashMap<String, String>>() .unwrap()); } |