From 8f249751eaa1f3a14de25de4299e6a0c15572bff Mon Sep 17 00:00:00 2001 From: AramJonghu Date: Thu, 9 Jul 2026 15:06:07 +0200 Subject: [PATCH] progress variables --- Cargo.toml | 1 - exercises/01_variables/variables5.rs | 2 +- exercises/01_variables/variables6.rs | 2 +- exercises/02_functions/functions1.rs | 3 +++ exercises/02_functions/functions2.rs | 2 +- exercises/02_functions/functions3.rs | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f7bd407..192eeb6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,6 @@ exclude = [ "tests/test_exercises", "dev", - "exercises", ] [workspace.package] diff --git a/exercises/01_variables/variables5.rs b/exercises/01_variables/variables5.rs index cf5620d..f83c83d 100644 --- a/exercises/01_variables/variables5.rs +++ b/exercises/01_variables/variables5.rs @@ -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); } diff --git a/exercises/01_variables/variables6.rs b/exercises/01_variables/variables6.rs index 4a040fd..deb33ed 100644 --- a/exercises/01_variables/variables6.rs +++ b/exercises/01_variables/variables6.rs @@ -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}"); diff --git a/exercises/02_functions/functions1.rs b/exercises/02_functions/functions1.rs index a812c21..b228827 100644 --- a/exercises/02_functions/functions1.rs +++ b/exercises/02_functions/functions1.rs @@ -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 diff --git a/exercises/02_functions/functions2.rs b/exercises/02_functions/functions2.rs index 2c773c6..fe36fee 100644 --- a/exercises/02_functions/functions2.rs +++ b/exercises/02_functions/functions2.rs @@ -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); } diff --git a/exercises/02_functions/functions3.rs b/exercises/02_functions/functions3.rs index 8d65477..380d5bd 100644 --- a/exercises/02_functions/functions3.rs +++ b/exercises/02_functions/functions3.rs @@ -6,5 +6,5 @@ fn call_me(num: u8) { fn main() { // TODO: Fix the function call. - call_me(); + call_me(32); }