Skip to content

Commit 38f08d2

Browse files
committed
refactor: use pub(crate) use macro; instead of #[macro_use]
This is the more modern and reasonable form to make a macro available to the whole crate.
1 parent 13d1f66 commit 38f08d2

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

shared/src/bee_msg.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! BeeGFS network message definitions
22
33
use crate::bee_serde::*;
4+
use crate::impl_macros::*;
45
use crate::types::*;
56
use anyhow::{Context, Result, anyhow};
67
use bee_serde_derive::BeeSerde;

shared/src/impl_macros.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ macro_rules! impl_enum_bee_msg_traits {
3838
};
3939
}
4040

41+
pub(crate) use impl_enum_bee_msg_traits;
42+
4143
macro_rules! impl_enum_user_str {
4244
($type:ty, $($variant:path => $text:literal),+ $(,)?) => {
4345
impl $type {
@@ -58,6 +60,8 @@ macro_rules! impl_enum_user_str {
5860
};
5961
}
6062

63+
pub(crate) use impl_enum_user_str;
64+
6165
#[cfg(feature = "grpc")]
6266
macro_rules! impl_enum_protobuf_traits {
6367
($type:ty => $proto_type:ty, unspecified => $proto_unspec_variant:path, $($variant:path => $proto_variant:path),+ $(,)?) => {
@@ -93,3 +97,6 @@ macro_rules! impl_enum_protobuf_traits {
9397
}
9498
};
9599
}
100+
101+
#[cfg(feature = "grpc")]
102+
pub(crate) use impl_enum_protobuf_traits;

shared/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44
//! from, the [serializer](bee_serde), [connection](conn) handling and other utilities and
55
//! definitions.
66
7-
#[macro_use]
8-
mod impl_macros;
9-
107
pub mod bee_msg;
118
pub mod bee_serde;
129
pub mod conn;
1310
#[cfg(feature = "grpc")]
1411
pub mod grpc;
12+
pub(crate) mod impl_macros;
1513
pub mod journald_logger;
1614
pub mod nic;
1715
pub mod parser;

shared/src/types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Various BeeGFS type definitions, mainly for use by BeeMsg.
22
33
use crate::bee_serde::*;
4+
use crate::impl_macros::*;
45
use anyhow::{Context, Result, anyhow};
56
use bee_serde_derive::BeeSerde;
67
use core::hash::Hash;

0 commit comments

Comments
 (0)