about summary refs log tree commit diff
path: root/library/std/src/net
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-11-27 08:13:47 +0100
committerGitHub <noreply@github.com>2024-11-27 08:13:47 +0100
commitdcebc5eddd4dccc444d68eae8d5d321d63d2c06f (patch)
tree8426e7689712ffaf7a2a451babd6e5d94cc47665 /library/std/src/net
parent21f6ef577ba8936d2e78c349e4062635818cbc6a (diff)
parentc14d137bfc5133f5a38fad2f58e30fed9c47ffe2 (diff)
Rollup merge of #133449 - joboet:io_const_error, r=tgross35
std: expose `const_io_error!` as `const_error!`

ACP: https://github.com/rust-lang/libs-team/issues/205
Tracking issue: https://github.com/rust-lang/rust/issues/133448

Probably best reviewed commit-by-commit, the first one does the API change, the second does the mass-rename.
Diffstat (limited to 'library/std/src/net')
-rw-r--r--library/std/src/net/mod.rs2
-rw-r--r--library/std/src/net/udp.rs4
2 files changed, 2 insertions, 4 deletions
diff --git a/library/std/src/net/mod.rs b/library/std/src/net/mod.rs
index 3b19c743b1e..ddd3b68dd2d 100644
--- a/library/std/src/net/mod.rs
+++ b/library/std/src/net/mod.rs
@@ -84,6 +84,6 @@ where
         }
     }
     Err(last_err.unwrap_or_else(|| {
-        io::const_io_error!(ErrorKind::InvalidInput, "could not resolve to any addresses")
+        io::const_error!(ErrorKind::InvalidInput, "could not resolve to any addresses")
     }))
 }
diff --git a/library/std/src/net/udp.rs b/library/std/src/net/udp.rs
index 6df47d7b0e0..674c5fb7d6e 100644
--- a/library/std/src/net/udp.rs
+++ b/library/std/src/net/udp.rs
@@ -203,9 +203,7 @@ impl UdpSocket {
     pub fn send_to<A: ToSocketAddrs>(&self, buf: &[u8], addr: A) -> io::Result<usize> {
         match addr.to_socket_addrs()?.next() {
             Some(addr) => self.0.send_to(buf, &addr),
-            None => {
-                Err(io::const_io_error!(ErrorKind::InvalidInput, "no addresses to send data to"))
-            }
+            None => Err(io::const_error!(ErrorKind::InvalidInput, "no addresses to send data to")),
         }
     }