1
1
// modules2.rs
2
2
// Make me compile! Scroll down for hints :)
3
3
4
- mod us_presidential_frontrunners {
5
- use self :: democrats :: HILLARY_CLINTON as democrat ;
6
- use self :: republicans :: DONALD_TRUMP as republican ;
4
+ mod delicious_snacks {
5
+ use self :: fruits :: PEAR as fruit ;
6
+ use self :: veggies :: CUCUMBER as veggie ;
7
7
8
- mod democrats {
9
- pub const HILLARY_CLINTON : & ' static str = "Hillary Clinton " ;
10
- pub const BERNIE_SANDERS : & ' static str = "Bernie Sanders " ;
8
+ mod fruits {
9
+ pub const PEAR : & ' static str = "Pear " ;
10
+ pub const APPLE : & ' static str = "Apple " ;
11
11
}
12
12
13
- mod republicans {
14
- pub const DONALD_TRUMP : & ' static str = "Donald Trump " ;
15
- pub const JEB_BUSH : & ' static str = "Jeb Bush " ;
13
+ mod veggies {
14
+ pub const CUCUMBER : & ' static str = "Cucumber " ;
15
+ pub const CARROT : & ' static str = "Carrot " ;
16
16
}
17
17
}
18
18
19
19
fn main ( ) {
20
- println ! ( "candidates : {} and {}" ,
21
- us_presidential_frontrunners :: democrat ,
22
- us_presidential_frontrunners :: republican ) ;
20
+ println ! ( "favorite snacks : {} and {}" ,
21
+ delicious_snacks :: fruit ,
22
+ delicious_snacks :: veggie ) ;
23
23
}
24
24
25
25
@@ -38,8 +38,8 @@ fn main() {
38
38
39
39
40
40
41
- // The us_presidential_frontrunners module is trying to present an external
42
- // interface (the `democrat ` and `republican ` constants) that is different than
43
- // its internal structure (the `democrats ` and `republicans ` modules and
41
+ // The delicious_snacks module is trying to present an external
42
+ // interface (the `fruit ` and `veggie ` constants) that is different than
43
+ // its internal structure (the `fruits ` and `veggies ` modules and
44
44
// associated constants). It's almost there except for one keyword missing for
45
45
// each constant.
0 commit comments