1
0
mirror of https://github.com/rust-lang/rustlings.git synced 2025-05-27 22:57:45 +02:00

Apply Clippy lints

This commit is contained in:
mo8it 2025-05-12 20:31:13 +02:00
parent a063bcfb4c
commit 48bab77609
3 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
fn main() {
let number = "T-H-R-E-E"; // Don't change this line
println!("Spell a number: {}", number);
println!("Spell a number: {number}");
// TODO: Fix the compiler error by changing the line below without renaming the variable.
number = 3;

View File

@ -1,6 +1,6 @@
fn main() {
let number = "T-H-R-E-E";
println!("Spell a number: {}", number);
println!("Spell a number: {number}");
// Using variable shadowing
// https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html#shadowing

View File

@ -15,7 +15,7 @@ fn main() {
-1, -2, -3,
-4, -5, -6,
];
println!("My array! Here it is: {:?}", my_arr);
println!("My array! Here it is: {my_arr:?}");
let mut my_empty_vec = vec![1, 2, 3, 4, 5];
// `resize` mutates a vector instead of returning a new one.
@ -27,5 +27,5 @@ fn main() {
let mut value_b = 66;
// Use `mem::swap` to correctly swap two values.
mem::swap(&mut value_a, &mut value_b);
println!("value a: {}; value b: {}", value_a, value_b);
println!("value a: {value_a}; value b: {value_b}");
}