From 364015c14ebdb734a25e960d00f060eb5d8af9ba Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 17 Jun 2026 19:13:58 +0530 Subject: [PATCH] docs: clarify variables5 mutability --- exercises/01_variables/README.md | 1 + exercises/01_variables/variables5.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/exercises/01_variables/README.md b/exercises/01_variables/README.md index 5ba2efcaa2..587882eef3 100644 --- a/exercises/01_variables/README.md +++ b/exercises/01_variables/README.md @@ -3,6 +3,7 @@ In Rust, variables are immutable by default. When a variable is immutable, once a value is bound to a name, you can't change that value. You can make them mutable by adding `mut` in front of the variable name. +`variables5` is about that `mut` keyword, not shadowing. ## Further information diff --git a/exercises/01_variables/variables5.rs b/exercises/01_variables/variables5.rs index cf5620da5f..d4918f8b5c 100644 --- a/exercises/01_variables/variables5.rs +++ b/exercises/01_variables/variables5.rs @@ -2,7 +2,8 @@ fn main() { let number = "T-H-R-E-E"; // Don't change this line println!("Spell a number: {number}"); - // TODO: Fix the compiler error by changing the line below without renaming the variable. + // TODO: Fix the compiler error by making `number` mutable. + // This exercise is about mutability, not shadowing. number = 3; println!("Number plus two is: {}", number + 2); }