Skip to content

Commit d2c61b6

Browse files
committed
remove unnecessary type bound
1 parent ff40561 commit d2c61b6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/net/addr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ cfg_if! {
3333
/// [`SocketAddr`]: https://doc.rust-lang.org/std/net/enum.SocketAddr.html
3434
pub trait ToSocketAddrs {
3535
/// Returned iterator over socket addresses which this type may correspond to.
36-
type Iter: Iterator<Item = SocketAddr> + Send;
36+
type Iter: Iterator<Item = SocketAddr>;
3737

3838
/// Converts this object to an iterator of resolved `SocketAddr`s.
3939
///
@@ -142,7 +142,7 @@ impl<'a> ToSocketAddrs for &'a [SocketAddr] {
142142
}
143143
}
144144

145-
impl<T: ToSocketAddrs + Unpin + ?Sized> ToSocketAddrs for &T {
145+
impl<T: ToSocketAddrs + ?Sized> ToSocketAddrs for &T {
146146
type Iter = T::Iter;
147147

148148
fn to_socket_addrs(&self) -> ret!(ToSocketAddrsFuture, Self::Iter) {

tests/addr.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
33
use async_std::net::ToSocketAddrs;
44
use async_std::task;
55

6-
fn blocking_resolve<A: ToSocketAddrs>(a: A) -> Result<Vec<SocketAddr>, String> {
6+
fn blocking_resolve<A>(a: A) -> Result<Vec<SocketAddr>, String>
7+
where
8+
A: ToSocketAddrs,
9+
A::Iter: Send,
10+
{
711
let socket_addrs = task::block_on(a.to_socket_addrs());
812
match socket_addrs {
913
Ok(a) => Ok(a.collect()),

0 commit comments

Comments
 (0)