From 5d7de5017bd39812fee0b9472e6d430506b5b043 Mon Sep 17 00:00:00 2001 From: Joshua Simmons Date: Sat, 6 Apr 2024 00:18:05 +0200 Subject: [PATCH] shark: Enable RUST_BACKTRACE by default In debug builds we always want to enable backtraces if they're not explicitly disabled by the environment variable. --- title/shark/src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/title/shark/src/main.rs b/title/shark/src/main.rs index 1bed121..cbd6386 100644 --- a/title/shark/src/main.rs +++ b/title/shark/src/main.rs @@ -25,6 +25,11 @@ const NUM_SHARKS: usize = 50; const GLYPH_CACHE_SIZE: usize = 1024; pub fn main() { + #[cfg(debug_assertions)] + if std::env::var("RUST_BACKTRACE").is_err() { + std::env::set_var("RUST_BACKTRACE", "1") + } + let app = create_app(); let main_window = app.create_window(&WindowDesc { title: "shark", -- 2.49.0