Skip to content

Commit edc6d92

Browse files
authored
Merge pull request #109 from dead-claudia/patch-1
Ensure macro-internal variables are properly encapsulated
2 parents acdfb96 + 7b13ad7 commit edc6d92

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ pub struct Metadata {
6969
/// Initialize [`Metadata`]
7070
#[macro_export]
7171
macro_rules! metadata {
72-
() => {
72+
() => {{
7373
$crate::Metadata {
7474
version: env!("CARGO_PKG_VERSION").into(),
7575
name: env!("CARGO_PKG_NAME").into(),
7676
authors: env!("CARGO_PKG_AUTHORS").replace(":", ", ").into(),
7777
homepage: env!("CARGO_PKG_HOMEPAGE").into(),
7878
}
79-
};
79+
}};
8080
}
8181

8282
/// `human-panic` initialisation macro
@@ -103,7 +103,7 @@ macro_rules! metadata {
103103
/// ```
104104
#[macro_export]
105105
macro_rules! setup_panic {
106-
($meta:expr) => {
106+
($meta:expr) => {{
107107
#[allow(unused_imports)]
108108
use std::panic::{self, PanicInfo};
109109
#[allow(unused_imports)]
@@ -121,7 +121,7 @@ macro_rules! setup_panic {
121121
}));
122122
}
123123
}
124-
};
124+
}};
125125

126126
() => {
127127
$crate::setup_panic!($crate::metadata!());

0 commit comments

Comments
 (0)