From 7f44b3a118a93497b3d60cb161dc71c1d2cb7e72 Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Fri, 25 Feb 2022 13:03:41 +0100 Subject: [PATCH 1/2] Rename unix::net::SocketAddr::from_path to from_pathname Matching SocketAddr::as_pathname. --- library/std/src/os/unix/net/addr.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/std/src/os/unix/net/addr.rs b/library/std/src/os/unix/net/addr.rs index 034fa301ba1ea..62bf4b6e862c6 100644 --- a/library/std/src/os/unix/net/addr.rs +++ b/library/std/src/os/unix/net/addr.rs @@ -145,7 +145,7 @@ impl SocketAddr { /// use std::path::Path; /// /// # fn main() -> std::io::Result<()> { - /// let address = SocketAddr::from_path("/path/to/socket")?; + /// let address = SocketAddr::from_pathname("/path/to/socket")?; /// assert_eq!(address.as_pathname(), Some(Path::new("/path/to/socket"))); /// # Ok(()) /// # } @@ -157,10 +157,10 @@ impl SocketAddr { /// #![feature(unix_socket_creation)] /// use std::os::unix::net::SocketAddr; /// - /// assert!(SocketAddr::from_path("/path/with/\0/bytes").is_err()); + /// assert!(SocketAddr::from_pathname("/path/with/\0/bytes").is_err()); /// ``` #[unstable(feature = "unix_socket_creation", issue = "93423")] - pub fn from_path

(path: P) -> io::Result + pub fn from_pathname

(path: P) -> io::Result where P: AsRef, { From a84e77bebff4b3a0ab30108d720b47ddb6d027df Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Fri, 25 Feb 2022 13:04:40 +0100 Subject: [PATCH 2/2] Stabilize unix_socket_creation --- library/std/src/os/unix/net/addr.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/library/std/src/os/unix/net/addr.rs b/library/std/src/os/unix/net/addr.rs index 62bf4b6e862c6..03d59d773115e 100644 --- a/library/std/src/os/unix/net/addr.rs +++ b/library/std/src/os/unix/net/addr.rs @@ -140,7 +140,6 @@ impl SocketAddr { /// # Examples /// /// ``` - /// #![feature(unix_socket_creation)] /// use std::os::unix::net::SocketAddr; /// use std::path::Path; /// @@ -154,12 +153,11 @@ impl SocketAddr { /// Creating a `SocketAddr` with a NULL byte results in an error. /// /// ``` - /// #![feature(unix_socket_creation)] /// use std::os::unix::net::SocketAddr; /// /// assert!(SocketAddr::from_pathname("/path/with/\0/bytes").is_err()); /// ``` - #[unstable(feature = "unix_socket_creation", issue = "93423")] + #[stable(feature = "unix_socket_creation", since = "1.61.0")] pub fn from_pathname

(path: P) -> io::Result where P: AsRef,