Skip to content

Commit

Permalink
net: use std::future::ready instead of own Ready future
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Nov 23, 2021
1 parent cf32068 commit 61da7ed
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 37 deletions.
5 changes: 0 additions & 5 deletions tokio/src/future/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ pub(crate) mod maybe_done;
mod poll_fn;
pub use poll_fn::poll_fn;

cfg_not_loom! {
mod ready;
pub(crate) use ready::{ok, Ready};
}

cfg_process! {
mod try_join;
pub(crate) use try_join::try_join3;
Expand Down
27 changes: 0 additions & 27 deletions tokio/src/future/ready.rs

This file was deleted.

9 changes: 4 additions & 5 deletions tokio/src/net/addr.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::future;

use std::future;
use std::io;
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};

Expand Down Expand Up @@ -56,7 +55,7 @@ impl sealed::ToSocketAddrsPriv for SocketAddr {

fn to_socket_addrs(&self, _: sealed::Internal) -> Self::Future {
let iter = Some(*self).into_iter();
future::ok(iter)
future::ready(Ok(iter))
}
}

Expand Down Expand Up @@ -96,7 +95,7 @@ impl sealed::ToSocketAddrsPriv for (IpAddr, u16) {

fn to_socket_addrs(&self, _: sealed::Internal) -> Self::Future {
let iter = Some(SocketAddr::from(*self)).into_iter();
future::ok(iter)
future::ready(Ok(iter))
}
}

Expand Down Expand Up @@ -138,7 +137,7 @@ impl sealed::ToSocketAddrsPriv for &[SocketAddr] {

fn to_socket_addrs(&self, _: sealed::Internal) -> Self::Future {
let iter = self.to_vec().into_iter();
future::ok(iter)
future::ready(Ok(iter))
}
}

Expand Down

0 comments on commit 61da7ed

Please sign in to comment.