Merge pull request #8 from 2nd-Layer/disable_unix_socket_on_non-unix_system

feat: Disable Unix socket on non-unix platforms
This commit is contained in:
Santiago Carmuega 2021-12-17 06:58:06 -03:00 committed by GitHub
commit 70b412af1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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