Skip to content

Commit 3f17999

Browse files
Merge pull request #222 from matthiasbeyer/fix-221
Make sure examples build
2 parents 0d3a5c3 + 22281f1 commit 3f17999

File tree

4 files changed

+39
-12
lines changed

4 files changed

+39
-12
lines changed

.github/workflows/msrv.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,30 @@ jobs:
137137
with:
138138
command: clippy
139139
args: -- -D warnings
140+
141+
check-examples:
142+
name: Check examples
143+
needs: [check]
144+
runs-on: ubuntu-latest
145+
strategy:
146+
matrix:
147+
rust:
148+
- 1.46.0
149+
- stable
150+
151+
steps:
152+
- name: Checkout sources
153+
uses: actions/checkout@v2
154+
155+
- name: Install toolchain
156+
uses: actions-rs/toolchain@v1
157+
with:
158+
toolchain: ${{ matrix.rust }}
159+
override: true
160+
161+
- name: Run cargo check
162+
uses: actions-rs/cargo@v1
163+
with:
164+
command: check
165+
args: --examples
166+

examples/glob/src/main.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::path::Path;
2-
use std::collections::Map;
2+
use std::collections::HashMap;
33
use config::*;
44
use glob::glob;
55

@@ -14,9 +14,9 @@ fn main() {
1414
.merge(File::from(Path::new("conf/05-some.yml"))).unwrap()
1515
.merge(File::from(Path::new("conf/99-extra.json"))).unwrap();
1616

17-
// Print out our settings (as a Map)
17+
// Print out our settings (as a HashMap)
1818
println!("\n{:?} \n\n-----------",
19-
settings.try_into::<Map<String, String>>().unwrap());
19+
settings.try_into::<HashMap<String, String>>().unwrap());
2020

2121
// Option 2
2222
// --------
@@ -28,9 +28,9 @@ fn main() {
2828
File::from(Path::new("conf/99-extra.json"))])
2929
.unwrap();
3030

31-
// Print out our settings (as a Map)
31+
// Print out our settings (as a HashMap)
3232
println!("\n{:?} \n\n-----------",
33-
settings.try_into::<Map<String, String>>().unwrap());
33+
settings.try_into::<HashMap<String, String>>().unwrap());
3434

3535
// Option 3
3636
// --------
@@ -43,7 +43,7 @@ fn main() {
4343
.collect::<Vec<_>>())
4444
.unwrap();
4545

46-
// Print out our settings (as a Map)
46+
// Print out our settings (as a HashMap)
4747
println!("\n{:?} \n\n-----------",
48-
settings.try_into::<Map<String, String>>().unwrap());
48+
settings.try_into::<HashMap<String, String>>().unwrap());
4949
}

examples/simple/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::collections::Map;
1+
use std::collections::HashMap;
22

33
fn main() {
44
let mut settings = config::Config::default();
@@ -9,7 +9,7 @@ fn main() {
99
// Eg.. `APP_DEBUG=1 ./target/app` would set the `debug` key
1010
.merge(config::Environment::with_prefix("APP")).unwrap();
1111

12-
// Print out our settings (as a Map)
12+
// Print out our settings (as a HashMap)
1313
println!("{:?}",
14-
settings.try_into::<Map<String, String>>().unwrap());
14+
settings.try_into::<HashMap<String, String>>().unwrap());
1515
}

examples/watch/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use config::*;
2-
use std::collections::Map;
2+
use std::collections::HashMap;
33
use std::sync::RwLock;
44
use notify::{RecommendedWatcher, DebouncedEvent, Watcher, RecursiveMode};
55
use std::sync::mpsc::channel;
@@ -20,7 +20,7 @@ fn show() {
2020
.read()
2121
.unwrap()
2222
.clone()
23-
.try_into::<Map<String, String>>()
23+
.try_into::<HashMap<String, String>>()
2424
.unwrap());
2525
}
2626

0 commit comments

Comments
 (0)