From: Joshua Simmons Date: Fri, 5 Apr 2024 22:18:05 +0000 (+0200) Subject: shark: Enable RUST_BACKTRACE by default X-Git-Url: https://git.nega.tv//gitweb.cgi?a=commitdiff_plain;h=5d7de5017bd39812fee0b9472e6d430506b5b043;p=josh%2Fnarcissus 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. --- 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",