about summary refs log tree commit diff
path: root/library/std/src/sys/net
diff options
context:
space:
mode:
authorThalia Archibald <thalia@archibald.dev>2025-02-10 16:20:21 -0800
committerThalia Archibald <thalia@archibald.dev>2025-02-10 16:20:21 -0800
commit7edd034a1f6ab10f73779521a231537d64398c2a (patch)
treed77fb034a7af3b4b5f651c4c41a9946054de4114 /library/std/src/sys/net
parent6171d944aea415a3023d4262e0895aa3b18c771f (diff)
Use io::const_error! when possible over io::Error::new
Diffstat (limited to 'library/std/src/sys/net')
-rw-r--r--library/std/src/sys/net/connection/xous/tcplistener.rs2
-rw-r--r--library/std/src/sys/net/connection/xous/tcpstream.rs2
-rw-r--r--library/std/src/sys/net/connection/xous/udp.rs2
3 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/sys/net/connection/xous/tcplistener.rs b/library/std/src/sys/net/connection/xous/tcplistener.rs
index 640a02a64f5..ab15ddfeb50 100644
--- a/library/std/src/sys/net/connection/xous/tcplistener.rs
+++ b/library/std/src/sys/net/connection/xous/tcplistener.rs
@@ -182,7 +182,7 @@ impl TcpListener {
 
     pub fn set_ttl(&self, ttl: u32) -> io::Result<()> {
         if ttl > 255 {
-            return Err(io::Error::new(io::ErrorKind::InvalidInput, "TTL must be less than 256"));
+            return Err(io::const_error!(io::ErrorKind::InvalidInput, "TTL must be less than 256"));
         }
         crate::os::xous::ffi::blocking_scalar(
             services::net_server(),
diff --git a/library/std/src/sys/net/connection/xous/tcpstream.rs b/library/std/src/sys/net/connection/xous/tcpstream.rs
index 572dd6b3b63..3f4cc97c2a9 100644
--- a/library/std/src/sys/net/connection/xous/tcpstream.rs
+++ b/library/std/src/sys/net/connection/xous/tcpstream.rs
@@ -370,7 +370,7 @@ impl TcpStream {
 
     pub fn set_ttl(&self, ttl: u32) -> io::Result<()> {
         if ttl > 255 {
-            return Err(io::Error::new(io::ErrorKind::InvalidInput, "TTL must be less than 256"));
+            return Err(io::const_error!(io::ErrorKind::InvalidInput, "TTL must be less than 256"));
         }
         crate::os::xous::ffi::blocking_scalar(
             services::net_server(),
diff --git a/library/std/src/sys/net/connection/xous/udp.rs b/library/std/src/sys/net/connection/xous/udp.rs
index 1b7ecac6d3a..887a3e97c86 100644
--- a/library/std/src/sys/net/connection/xous/udp.rs
+++ b/library/std/src/sys/net/connection/xous/udp.rs
@@ -360,7 +360,7 @@ impl UdpSocket {
 
     pub fn set_ttl(&self, ttl: u32) -> io::Result<()> {
         if ttl > 255 {
-            return Err(io::Error::new(io::ErrorKind::InvalidInput, "TTL must be less than 256"));
+            return Err(io::const_error!(io::ErrorKind::InvalidInput, "TTL must be less than 256"));
         }
         crate::os::xous::ffi::blocking_scalar(
             services::net_server(),