-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exercises for understanding the module system #9
Comments
Another: // Make this compile!
mod presidential_frontrunners {
use self::democrats::HILARY_CLINTON as democrat;
use self::republicans::DONALD_TRUMP as republican;
mod democrats {
pub const HILARY_CLINTON: &'static str = "Hilary Clinton";
pub const BERNIE_SANDERS: &'static str = "Bernie Sanders";
}
mod republicans {
pub const DONALD_TRUMP: &'static str = "Donald Trump";
pub const JEB_BUSH: &'static str = "Jeb Bush";
}
}
fn main() {
println!("candidates: {} and {}",
presidential_frontrunners::democrat,
presidential_frontrunners::republican);
} |
Added these in a modules section! Thank you!!! I'm adding this one and the std library types ones first since they're less advanced than the other exercises you've made so I wanted to incorporate them first :) I will add the others though, they're awesome!! |
xymopen
added a commit
to xymopen/rustlings-solutions
that referenced
this issue
Oct 14, 2019
ppp3
pushed a commit
to ppp3/rustlings
that referenced
this issue
May 23, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's a straightforward one to start:
The text was updated successfully, but these errors were encountered: