-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a macro to build new socket names
Then we can re-use it throughout without affecting the underlying API too much
- Loading branch information
1 parent
e4724b3
commit 821d5ea
Showing
4 changed files
with
91 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,27 @@ | ||
pub use follower::*; | ||
pub use leader::*; | ||
pub(crate) use socket::*; | ||
pub use types::*; | ||
|
||
mod follower; | ||
mod leader; | ||
mod socket; | ||
mod types; | ||
|
||
pub use follower::*; | ||
pub use leader::*; | ||
pub(crate) use socket::*; | ||
pub use types::*; | ||
macro_rules! create_socket_name { | ||
($raw_socket_name:expr) => { | ||
if GenericFilePath::is_supported() { | ||
$raw_socket_name | ||
.clone() | ||
.to_fs_name::<GenericFilePath>() | ||
.unwrap() | ||
} else { | ||
$raw_socket_name | ||
.clone() | ||
.to_ns_name::<GenericNamespaced>() | ||
.unwrap() | ||
} | ||
}; | ||
} | ||
|
||
pub(crate) use create_socket_name; |