1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-29 03:51:35 +02:00

Inline format vars to make the format str simpler (#551)

This commit is contained in:
Yuri Astrakhan
2023-04-06 06:00:10 -04:00
committed by GitHub
parent 86d8c4ae54
commit 5cdb73387f
5 changed files with 9 additions and 10 deletions

View File

@ -42,8 +42,7 @@ pub fn luhn(cc_number: &str) -> bool {
fn main() {
let cc_number = "1234 5678 1234 5670";
println!(
"Is {} a valid credit card number? {}",
cc_number,
"Is {cc_number} a valid credit card number? {}",
if luhn(cc_number) { "yes" } else { "no" }
);
}