Appease clippy

This commit is contained in:
Simon Gellis 2025-07-13 00:46:08 -04:00
parent b6b0a8c22b
commit 065f68e9a8
3 changed files with 8 additions and 8 deletions

View File

@ -12,7 +12,7 @@ impl RegisterInfo {
pub fn to_description(&self) -> String {
let mut string = format!("name:{}", self.name);
if let Some(alt) = self.alt_name {
string.push_str(&format!(";alt-name:{}", alt));
string.push_str(&format!(";alt-name:{alt}"));
}
string.push_str(&format!(
";bitsize:32;offset:{};encoding:uint;format:hex;set:{};dwarf:{}",
@ -21,7 +21,7 @@ impl RegisterInfo {
self.dwarf
));
if let Some(generic) = self.generic {
string.push_str(&format!(";generic:{}", generic));
string.push_str(&format!(";generic:{generic}"));
}
string
}

View File

@ -227,7 +227,7 @@ impl Mappings for InputMapping {
for (keyboard_key, keys) in &self.keys {
let name = match keyboard_key {
PhysicalKey::Code(code) => format!("{code:?}"),
k => format!("{:?}", k),
k => format!("{k:?}"),
};
for key in keys.iter() {
results.entry(key).or_default().push(name.clone());

View File

@ -44,9 +44,9 @@ fn set_panic_handler() {
std::panic::set_hook(Box::new(|info| {
let mut message = String::new();
if let Some(msg) = info.payload().downcast_ref::<&str>() {
message += &format!("{}\n", msg);
message += &format!("{msg}\n");
} else if let Some(msg) = info.payload().downcast_ref::<String>() {
message += &format!("{}\n", msg);
message += &format!("{msg}\n");
}
if let Some(location) = info.location() {
message += &format!(
@ -56,9 +56,9 @@ fn set_panic_handler() {
);
}
let backtrace = std::backtrace::Backtrace::force_capture();
message += &format!("stack trace:\n{:#}\n", backtrace);
message += &format!("stack trace:\n{backtrace:#}\n");
eprint!("{}", message);
eprint!("{message}");
let Some(project_dirs) = directories::ProjectDirs::from("com", "virtual-boy", "Lemur")
else {
@ -72,7 +72,7 @@ fn set_panic_handler() {
.duration_since(SystemTime::UNIX_EPOCH)
.unwrap()
.as_millis();
let logfile_name = format!("crash-{}.txt", timestamp);
let logfile_name = format!("crash-{timestamp}.txt");
let _ = std::fs::write(data_dir.join(logfile_name), message);
}));
}