Skip to content

Commit

Permalink
chore: use cfg! macro instead of #[cfg] attribute (#3446)
Browse files Browse the repository at this point in the history
this unifies the code path. The alternative will *move* arguments passed
to the debug_warn! macro only when compiling without debug_assertions.
This version will instead always use additional format arguments by reference.
  • Loading branch information
WorldSEnder authored Jan 10, 2025
1 parent 5293afd commit db9cabb
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions leptos_dom/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,9 @@ macro_rules! error {
macro_rules! debug_warn {
($($x:tt)*) => {
{
#[cfg(debug_assertions)]
{
if cfg!(debug_assertions) {
$crate::warn!($($x)*)
}
#[cfg(not(debug_assertions))]
{
($($x)*)
}
}
}
}
Expand Down

0 comments on commit db9cabb

Please sign in to comment.