Skip to content

Commit

Permalink
Rename unix::net::SocketAddr::from_path to from_pathname
Browse files Browse the repository at this point in the history
Matching SocketAddr::as_pathname.
  • Loading branch information
Thomasdezeeuw committed Feb 25, 2022
1 parent 03c8ffa commit 7f44b3a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/std/src/os/unix/net/addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
/// # }
Expand All @@ -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<P>(path: P) -> io::Result<SocketAddr>
pub fn from_pathname<P>(path: P) -> io::Result<SocketAddr>
where
P: AsRef<Path>,
{
Expand Down

0 comments on commit 7f44b3a

Please sign in to comment.