Skip to content

Commit

Permalink
Fix broken debug_print in release mode
Browse files Browse the repository at this point in the history
  • Loading branch information
temeddix committed Jun 18, 2024
1 parent a947a9d commit d01b571
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions rust_crate/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ macro_rules! debug_print {
( $( $t:tt )* ) => {
let rust_report = format!( $( $t )* );
#[cfg(debug_assertions)]
let result = $crate::send_rust_signal(
-1, // This is a special message ID for Rust reports
Vec::new(),
rust_report.clone().into_bytes(),
);
if let Err(error) = result {
println!("{error}\n{rust_report}");
{
let result = $crate::send_rust_signal(
-1, // This is a special message ID for Rust reports
Vec::new(),
rust_report.clone().into_bytes(),
);
if let Err(error) = result {
println!("{error}\n{rust_report}");
}
}
#[cfg(not(debug_assertions))]
let _ = rust_report;
Expand Down

0 comments on commit d01b571

Please sign in to comment.