Skip to content

Commit

Permalink
Revert "Suppress unused variable warning for debug_print macros (#1258)"
Browse files Browse the repository at this point in the history
This reverts commit b6dd935.
  • Loading branch information
cmichi committed May 25, 2022
1 parent 260946f commit f6a6aff
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions crates/env/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ cfg_if::cfg_if! {
/// `"pallet-contracts/unstable-interface"` feature to be enabled in the target runtime.
#[macro_export]
macro_rules! debug_print {
($($arg:expr),*) => ($crate::debug_message(&$crate::format!($($arg),*)));
($($arg:tt)*) => ($crate::debug_message(&$crate::format!($($arg)*)));
}

/// Appends a formatted string to the `debug_message` buffer, as per [`debug_print`] but
Expand All @@ -144,32 +144,22 @@ cfg_if::cfg_if! {
#[macro_export]
macro_rules! debug_println {
() => ($crate::debug_print!("\n"));
($($arg:expr),*) => (
$crate::debug_print!("{}\n", $crate::format!($($arg),*));
($($arg:tt)*) => (
$crate::debug_print!("{}\n", $crate::format!($($arg)*));
)
}
} else {
#[macro_export]
/// Debug messages disabled. Enable the `ink-debug` feature for contract debugging.
macro_rules! debug_print {
($($arg:expr),*) =>
{
{
let _ = || ($(&$arg),*);
}
};
($($arg:tt)*) => ();
}

#[macro_export]
/// Debug messages disabled. Enable the `ink-debug` feature for contract debugging.
macro_rules! debug_println {
() => {};
($($arg:expr),*) =>
{
{
let _ = || ($(&$arg),*);
}
};
() => ();
($($arg:tt)*) => ();
}
}
}

0 comments on commit f6a6aff

Please sign in to comment.