feat: Disable Unix socket on non-unix platforms

This commit is contained in:
Mark Stopka 2021-12-15 02:43:27 +01:00
parent 00adce7076
commit 7c66ae887a

View file

@ -1,6 +1,7 @@
use byteorder::{ByteOrder, NetworkEndian, WriteBytesExt}; use byteorder::{ByteOrder, NetworkEndian, WriteBytesExt};
use log::{debug, log_enabled, trace}; use log::{debug, log_enabled, trace};
use std::io::{Read, Write}; use std::io::{Read, Write};
#[cfg(target_family = "unix")]
use std::os::unix::net::UnixStream; use std::os::unix::net::UnixStream;
use std::{net::TcpStream, time::Instant}; use std::{net::TcpStream, time::Instant};
@ -78,6 +79,7 @@ impl Bearer for TcpStream {
} }
} }
#[cfg(target_family = "unix")]
impl Bearer for UnixStream { impl Bearer for UnixStream {
fn clone(&self) -> Self { fn clone(&self) -> Self {
self.try_clone().unwrap() self.try_clone().unwrap()