You've already forked comprehensive-rust
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:
@ -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" }
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user