diff --git a/Cargo.lock b/Cargo.lock index 32bc98d..04763d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,21 +63,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - [[package]] name = "arboard" version = "3.5.0" @@ -266,18 +251,6 @@ dependencies = [ "libc", ] -[[package]] -name = "chrono" -version = "0.4.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "windows-link", -] - [[package]] name = "clipboard-win" version = "5.4.0" @@ -846,7 +819,6 @@ name = "gta-tools" version = "0.5.3" dependencies = [ "catppuccin-egui", - "chrono", "eframe", "egui_extras", "image", @@ -907,30 +879,6 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" -[[package]] -name = "iana-time-zone" -version = "0.1.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "log", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - [[package]] name = "icu_collections" version = "1.5.0" diff --git a/Cargo.toml b/Cargo.toml index 076e1ef..3b2e3d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,6 @@ edition = "2024" catppuccin-egui = { version = "5.5.0", default-features = false, features = [ "egui31", ] } -chrono = { version = "0.4.40", default-features = false, features = ["clock"] } eframe = { version = "0.31.1", default-features = false, features = [ "glow", "default_fonts", diff --git a/src/gui/run.rs b/src/gui/run.rs index 4b54eb5..473e9a3 100644 --- a/src/gui/run.rs +++ b/src/gui/run.rs @@ -6,7 +6,11 @@ use crate::{ util::{self, consts::APP_STORAGE_PATH, persistent_state::PersistentState}, }; use eframe::egui; -use std::{fs::File, io::Write}; +use std::{ + fs::File, + io::Write, + time::{SystemTime, UNIX_EPOCH}, +}; fn panic_hook(panic_info: &std::panic::PanicHookInfo<'_>) { let log_path = APP_STORAGE_PATH.join("panic.log"); @@ -15,7 +19,10 @@ fn panic_hook(panic_info: &std::panic::PanicHookInfo<'_>) { .append(true) .open(log_path) .unwrap(); - let timestamp = chrono::Local::now().to_rfc3339_opts(chrono::SecondsFormat::Secs, false); + let timestamp = SystemTime::now() + .duration_since(UNIX_EPOCH) + .unwrap() + .as_secs(); let backtrace = std::backtrace::Backtrace::force_capture(); let message = format!("[{timestamp}]\n{panic_info}\nstack backtrace:\n{backtrace}\n"); file.write_all(message.as_bytes()).unwrap();