File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ // variables5.rs
2
+ // Make me compile! Execute the command `rustlings hint variables6` if you want a hint :)
3
+
4
+ // I AM NOT DONE
5
+
6
+ const NUMBER = 3 ;
7
+ fn main ( ) {
8
+ println ! ( "Number {}" , NUMBER ) ;
9
+ }
Original file line number Diff line number Diff line change @@ -56,6 +56,21 @@ You can read more about 'Shadowing' in the book's section 'Variables and Mutabil
56
56
https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html#shadowing
57
57
Try to solve this exercise afterwards using this technique."""
58
58
59
+ [[exercises ]]
60
+ name = " variables6"
61
+ path = " exercises/variables/variables6.rs"
62
+ mode = " compile"
63
+ hint = """
64
+ We know about variables and mutability, but there is another important type of
65
+ variable available; constants.
66
+ Constants are always immutable and they are declared with keyword 'const' rather
67
+ then keyword 'let'.
68
+ Constants types must also always be annotated.
69
+
70
+ Read more about constants under 'Differences Between Variables and Constants' in the book's section 'Variables and Mutability':
71
+ https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html
72
+ """
73
+
59
74
# IF
60
75
61
76
[[exercises ]]
You can’t perform that action at this time.
0 commit comments