Skip to content
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

feat: Add exercise variables6 covering const #352

Merged
merged 1 commit into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions exercises/variables/variables6.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// variables5.rs
// Make me compile! Execute the command `rustlings hint variables6` if you want a hint :)

// I AM NOT DONE

const NUMBER = 3;
fn main() {
println!("Number {}", NUMBER);
}
15 changes: 15 additions & 0 deletions info.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@ You can read more about 'Shadowing' in the book's section 'Variables and Mutabil
https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html#shadowing
Try to solve this exercise afterwards using this technique."""

[[exercises]]
name = "variables6"
path = "exercises/variables/variables6.rs"
mode = "compile"
hint = """
We know about variables and mutability, but there is another important type of
variable available; constants.
Constants are always immutable and they are declared with keyword 'const' rather
then keyword 'let'.
Constants types must also always be annotated.
Read more about constants under 'Differences Between Variables and Constants' in the book's section 'Variables and Mutability':
https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html
"""

# IF

[[exercises]]
Expand Down