Skip to content

Commit

Permalink
Let's try to match expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
athei committed May 17, 2022
1 parent d6c2b1a commit 2f15aeb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 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:tt),*) => ($crate::debug_message(&$crate::format!($($arg0,)*)));
($($arg:expr),*) => ($crate::debug_message(&$crate::format!($($arg),*)));
}

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

0 comments on commit 2f15aeb

Please sign in to comment.