Skip to content

Commit 5178789

Browse files
committed
Use non-captured identifier in format string
To ensure that MSRV of 1.56.1 still holds, replace the captured identifier in format strings. Capturing identifierts for format strings was introduced with Rust 1.58.0.
1 parent cb8c1e7 commit 5178789

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

rustler_tests/native/rustler_test/src/test_tuple.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ pub fn greeting_person_from_tuple(age_and_name: (u8, &str)) -> String {
3434
let (age, name) = age_and_name;
3535

3636
if age > 18 {
37-
format!("Hello, {name}! You are allowed in the bar area.")
37+
format!("Hello, {}! You are allowed in the bar area.", name)
3838
} else {
39-
format!("Hi, {name}! I'm sorry, but you are not allowed in the bar area.")
39+
format!(
40+
"Hi, {}! I'm sorry, but you are not allowed in the bar area.",
41+
name
42+
)
4043
}
4144
}

0 commit comments

Comments
 (0)