You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-27 19:18:59 +02:00
Inline format vars to make the format str simpler (#551)
This commit is contained in:
@ -52,7 +52,7 @@ extern "C" fn main(x0: u64, x1: u64, x2: u64, x3: u64) {
|
||||
// and nothing else accesses that address range.
|
||||
let rtc = unsafe { Rtc::new(PL031_BASE_ADDRESS) };
|
||||
let time = Utc.timestamp_opt(rtc.read().into(), 0).unwrap();
|
||||
info!("RTC: {}", time);
|
||||
info!("RTC: {time}");
|
||||
|
||||
// ANCHOR: main_end
|
||||
system_off().unwrap();
|
||||
@ -60,7 +60,7 @@ extern "C" fn main(x0: u64, x1: u64, x2: u64, x3: u64) {
|
||||
|
||||
#[panic_handler]
|
||||
fn panic(info: &PanicInfo) -> ! {
|
||||
error!("{}", info);
|
||||
error!("{info}");
|
||||
system_off().unwrap();
|
||||
loop {}
|
||||
}
|
||||
|
@ -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