Appease clippy
This commit is contained in:
+5
-5
@@ -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);
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user