Skip to content

Commit

Permalink
Ensure macro-internal variables are properly encapsulated
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-claudia authored Jun 13, 2023
1 parent acdfb96 commit 7b13ad7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ pub struct Metadata {
/// Initialize [`Metadata`]
#[macro_export]
macro_rules! metadata {
() => {
() => {{
$crate::Metadata {
version: env!("CARGO_PKG_VERSION").into(),
name: env!("CARGO_PKG_NAME").into(),
authors: env!("CARGO_PKG_AUTHORS").replace(":", ", ").into(),
homepage: env!("CARGO_PKG_HOMEPAGE").into(),
}
};
}};
}

/// `human-panic` initialisation macro
Expand All @@ -103,7 +103,7 @@ macro_rules! metadata {
/// ```
#[macro_export]
macro_rules! setup_panic {
($meta:expr) => {
($meta:expr) => {{
#[allow(unused_imports)]
use std::panic::{self, PanicInfo};
#[allow(unused_imports)]
Expand All @@ -121,7 +121,7 @@ macro_rules! setup_panic {
}));
}
}
};
}};

() => {
$crate::setup_panic!($crate::metadata!());
Expand Down

0 comments on commit 7b13ad7

Please sign in to comment.