[code] improve structure (focus: server)
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
#[macro_export]
|
||||
macro_rules! maybe_addr {
|
||||
($addr:expr) => {
|
||||
$addr.map_or("<unknown>".to_string(), |addr| addr.to_string())
|
||||
$addr.map_or(Arc::new("<unknown>".to_string()), |addr| {
|
||||
Arc::new(addr.to_string())
|
||||
})
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user