From 15445e3ac1ac4f33a78171e5db9f5e9ca047ffcd Mon Sep 17 00:00:00 2001 From: Stjepan Glavina Date: Fri, 23 Aug 2019 19:29:15 +0200 Subject: [PATCH] Remove re-exports in async_std::net --- src/net/mod.rs | 2 -- src/net/tcp/listener.rs | 3 ++- src/net/tcp/stream.rs | 3 ++- src/net/udp/mod.rs | 3 ++- tests/addr.rs | 4 ++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/net/mod.rs b/src/net/mod.rs index 9f4ef81..87a7d8e 100644 --- a/src/net/mod.rs +++ b/src/net/mod.rs @@ -29,8 +29,6 @@ //! # }) } //! ``` -pub use std::net::{SocketAddr, SocketAddrV4, SocketAddrV6}; - pub use addr::ToSocketAddrs; pub use tcp::{Incoming, TcpListener, TcpStream}; pub use udp::UdpSocket; diff --git a/src/net/tcp/listener.rs b/src/net/tcp/listener.rs index b0d4b58..0569dc3 100644 --- a/src/net/tcp/listener.rs +++ b/src/net/tcp/listener.rs @@ -1,3 +1,4 @@ +use std::net::SocketAddr; use std::pin::Pin; use cfg_if::cfg_if; @@ -7,7 +8,7 @@ use super::TcpStream; use crate::future::Future; use crate::io; use crate::net::driver::IoHandle; -use crate::net::{SocketAddr, ToSocketAddrs}; +use crate::net::ToSocketAddrs; use crate::task::{Context, Poll}; /// A TCP socket server, listening for connections. diff --git a/src/net/tcp/stream.rs b/src/net/tcp/stream.rs index c189680..7ed6a97 100644 --- a/src/net/tcp/stream.rs +++ b/src/net/tcp/stream.rs @@ -1,5 +1,6 @@ use std::io::{IoSlice, IoSliceMut}; use std::mem; +use std::net::SocketAddr; use std::pin::Pin; use cfg_if::cfg_if; @@ -8,7 +9,7 @@ use futures::io::{AsyncRead, AsyncWrite}; use crate::io; use crate::net::driver::IoHandle; -use crate::net::{SocketAddr, ToSocketAddrs}; +use crate::net::ToSocketAddrs; use crate::task::{Context, Poll}; /// A TCP stream between a local and a remote socket. diff --git a/src/net/udp/mod.rs b/src/net/udp/mod.rs index d41af8f..baf9988 100644 --- a/src/net/udp/mod.rs +++ b/src/net/udp/mod.rs @@ -1,11 +1,12 @@ use std::io; +use std::net::SocketAddr; use cfg_if::cfg_if; use futures::future; use std::net::{Ipv4Addr, Ipv6Addr}; use crate::net::driver::IoHandle; -use crate::net::{SocketAddr, ToSocketAddrs}; +use crate::net::ToSocketAddrs; use crate::task::Poll; /// A UDP socket. diff --git a/tests/addr.rs b/tests/addr.rs index 5635c6e..1538564 100644 --- a/tests/addr.rs +++ b/tests/addr.rs @@ -1,6 +1,6 @@ -use std::net::{Ipv4Addr, Ipv6Addr, SocketAddrV4, SocketAddrV6}; +use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6}; -use async_std::net::{SocketAddr, ToSocketAddrs}; +use async_std::net::ToSocketAddrs; use async_std::task; fn tsa(a: A) -> Result, String> {