mirror of
https://git.aramjonghu.dev/AramJonghu/rustlings.git
synced 2026-09-01 07:53:30 +02:00
progress variables
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
exclude = [
|
||||
"tests/test_exercises",
|
||||
"dev",
|
||||
"exercises",
|
||||
]
|
||||
|
||||
[workspace.package]
|
||||
|
||||
@@ -3,6 +3,6 @@ fn main() {
|
||||
println!("Spell a number: {number}");
|
||||
|
||||
// TODO: Fix the compiler error by changing the line below without renaming the variable.
|
||||
number = 3;
|
||||
let mut number = 3;
|
||||
println!("Number plus two is: {}", number + 2);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// TODO: Change the line below to fix the compiler error.
|
||||
const NUMBER = 3;
|
||||
const NUMBER: i32 = 3;
|
||||
|
||||
fn main() {
|
||||
println!("Number: {NUMBER}");
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
// TODO: Add some function with the name `call_me` without arguments or a return value.
|
||||
fn call_me() {
|
||||
|
||||
}
|
||||
|
||||
fn main() {
|
||||
call_me(); // Don't change this line
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// TODO: Add the missing type of the argument `num` after the colon `:`.
|
||||
fn call_me(num:) {
|
||||
fn call_me(num:i32) {
|
||||
for i in 0..num {
|
||||
println!("Ring! Call number {}", i + 1);
|
||||
}
|
||||
|
||||
@@ -6,5 +6,5 @@ fn call_me(num: u8) {
|
||||
|
||||
fn main() {
|
||||
// TODO: Fix the function call.
|
||||
call_me();
|
||||
call_me(32);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user