Skip to content

Commit

Permalink
refact(dubbo): use target_family
Browse files Browse the repository at this point in the history
  • Loading branch information
yang20150702 committed Jul 1, 2024
1 parent 2ec0197 commit df10d4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dubbo/src/triple/transport/connector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

pub mod http_connector;
pub mod https_connector;
#[cfg(any(target_os = "macos", target_os = "unix"))]
#[cfg(any(target_os = "macos", target_family = "unix"))]
pub mod unix_connector;

use hyper::Uri;
Expand Down Expand Up @@ -84,7 +84,7 @@ pub fn get_connector(connector: &str) -> BoxCloneService<Uri, BoxIO, crate::Erro
let c = https_connector::HttpsConnector::new();
BoxCloneService::new(Connector::new(c))
}
#[cfg(any(target_os = "macos", target_os = "unix"))]
#[cfg(any(target_os = "macos", target_family = "unix"))]
"unix" => {
let c = unix_connector::UnixConnector::new();
BoxCloneService::new(Connector::new(c))
Expand Down
4 changes: 2 additions & 2 deletions dubbo/src/triple/transport/listener/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

pub mod tcp_listener;
#[cfg(any(target_os = "macos", target_os = "unix"))]
#[cfg(any(target_os = "macos", target_family = "unix"))]
pub mod unix_listener;

use std::net::SocketAddr;
Expand Down Expand Up @@ -65,7 +65,7 @@ impl<T: Listener> Listener for WrappedListener<T> {
pub async fn get_listener(name: String, addr: SocketAddr) -> Result<BoxListener, crate::Error> {
match name.as_str() {
"tcp" => Ok(TcpListener::bind(addr).await?.boxed()),
#[cfg(any(target_os = "macos", target_os = "unix"))]
#[cfg(any(target_os = "macos", target_family = "unix"))]
"unix" => Ok(unix_listener::UnixListener::bind(addr).await?.boxed()),
_ => {
warn!("no support listener: {:?}", name);
Expand Down

0 comments on commit df10d4f

Please sign in to comment.