Skip to content

Commit 48bab77

Browse files
committed
Apply Clippy lints
1 parent a063bcf commit 48bab77

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

exercises/01_variables/variables5.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn main() {
22
let number = "T-H-R-E-E"; // Don't change this line
3-
println!("Spell a number: {}", number);
3+
println!("Spell a number: {number}");
44

55
// TODO: Fix the compiler error by changing the line below without renaming the variable.
66
number = 3;

solutions/01_variables/variables5.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn main() {
22
let number = "T-H-R-E-E";
3-
println!("Spell a number: {}", number);
3+
println!("Spell a number: {number}");
44

55
// Using variable shadowing
66
// https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html#shadowing

solutions/22_clippy/clippy3.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn main() {
1515
-1, -2, -3,
1616
-4, -5, -6,
1717
];
18-
println!("My array! Here it is: {:?}", my_arr);
18+
println!("My array! Here it is: {my_arr:?}");
1919

2020
let mut my_empty_vec = vec![1, 2, 3, 4, 5];
2121
// `resize` mutates a vector instead of returning a new one.
@@ -27,5 +27,5 @@ fn main() {
2727
let mut value_b = 66;
2828
// Use `mem::swap` to correctly swap two values.
2929
mem::swap(&mut value_a, &mut value_b);
30-
println!("value a: {}; value b: {}", value_a, value_b);
30+
println!("value a: {value_a}; value b: {value_b}");
3131
}

0 commit comments

Comments
 (0)