Skip to content

Commit 65eec85

Browse files
committed
Used the @ macro expansion prefix trick
1 parent 84ae95b commit 65eec85

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ pub mod lazy;
8080
#[macro_export]
8181
macro_rules! lazy_static {
8282
($(#[$attr:meta])* static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => {
83-
lazy_static!(PRIV, $(#[$attr])* static ref $N : $T = $e; $($t)*);
83+
lazy_static!(@PRIV, $(#[$attr])* static ref $N : $T = $e; $($t)*);
8484
};
8585
($(#[$attr:meta])* pub static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => {
86-
lazy_static!(PUB, $(#[$attr])* static ref $N : $T = $e; $($t)*);
86+
lazy_static!(@PUB, $(#[$attr])* static ref $N : $T = $e; $($t)*);
8787
};
88-
($VIS:ident, $(#[$attr:meta])* static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => {
89-
lazy_static!(MAKE TY, $VIS, $(#[$attr])*, $N);
88+
(@$VIS:ident, $(#[$attr:meta])* static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => {
89+
lazy_static!(@MAKE TY, $VIS, $(#[$attr])*, $N);
9090
impl ::std::ops::Deref for $N {
9191
type Target = $T;
9292
fn deref<'a>(&'a self) -> &'a $T {
@@ -104,7 +104,7 @@ macro_rules! lazy_static {
104104
}
105105
lazy_static!($($t)*);
106106
};
107-
(MAKE TY, PUB, $(#[$attr:meta])*, $N:ident) => {
107+
(@MAKE TY, PUB, $(#[$attr:meta])*, $N:ident) => {
108108
#[allow(missing_copy_implementations)]
109109
#[allow(non_camel_case_types)]
110110
#[allow(dead_code)]
@@ -113,7 +113,7 @@ macro_rules! lazy_static {
113113
#[doc(hidden)]
114114
pub static $N: $N = $N {__private_field: ()};
115115
};
116-
(MAKE TY, PRIV, $(#[$attr:meta])*, $N:ident) => {
116+
(@MAKE TY, PRIV, $(#[$attr:meta])*, $N:ident) => {
117117
#[allow(missing_copy_implementations)]
118118
#[allow(non_camel_case_types)]
119119
#[allow(dead_code)]

0 commit comments

Comments
 (0)