diff options
| author | joboet <jonasboettiger@icloud.com> | 2025-08-12 18:37:07 +0200 |
|---|---|---|
| committer | joboet <jonasboettiger@icloud.com> | 2025-09-08 16:58:43 +0200 |
| commit | 207a01e88f05f028f7a6c0db0d324fbedb8178a4 (patch) | |
| tree | 9665039af87815fc46c76329bcd80d93d2d09499 /library/std/src/net/mod.rs | |
| parent | 41f2b6b39e7526a28d50ff6918dda6de48add5e4 (diff) | |
| download | rust-207a01e88f05f028f7a6c0db0d324fbedb8178a4.tar.gz rust-207a01e88f05f028f7a6c0db0d324fbedb8178a4.zip | |
std: make address resolution weirdness local to SGX
Diffstat (limited to 'library/std/src/net/mod.rs')
| -rw-r--r-- | library/std/src/net/mod.rs | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/library/std/src/net/mod.rs b/library/std/src/net/mod.rs index ddd3b68dd2d..40f1a93e39d 100644 --- a/library/std/src/net/mod.rs +++ b/library/std/src/net/mod.rs @@ -34,7 +34,6 @@ pub use self::tcp::IntoIncoming; pub use self::tcp::{Incoming, TcpListener, TcpStream}; #[stable(feature = "rust1", since = "1.0.0")] pub use self::udp::UdpSocket; -use crate::io::{self, ErrorKind}; mod ip_addr; mod socket_addr; @@ -67,23 +66,3 @@ pub enum Shutdown { #[stable(feature = "rust1", since = "1.0.0")] Both, } - -fn each_addr<A: ToSocketAddrs, F, T>(addr: A, mut f: F) -> io::Result<T> -where - F: FnMut(io::Result<&SocketAddr>) -> io::Result<T>, -{ - let addrs = match addr.to_socket_addrs() { - Ok(addrs) => addrs, - Err(e) => return f(Err(e)), - }; - let mut last_err = None; - for addr in addrs { - match f(Ok(&addr)) { - Ok(l) => return Ok(l), - Err(e) => last_err = Some(e), - } - } - Err(last_err.unwrap_or_else(|| { - io::const_error!(ErrorKind::InvalidInput, "could not resolve to any addresses") - })) -} |
