Skip to content

Commit

Permalink
Move SockAddr::unix down
Browse files Browse the repository at this point in the history
This shouldn't be the first item in the documentation.
  • Loading branch information
Thomasdezeeuw committed Apr 11, 2023
1 parent d9ffccc commit 6e48562
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/sockaddr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@ pub struct SockAddr {

#[allow(clippy::len_without_is_empty)]
impl SockAddr {
/// Constructs a `SockAddr` with the family `AF_UNIX` and the provided path.
///
/// Returns an error if the path is longer than `SUN_LEN`.
pub fn unix<P>(path: P) -> io::Result<SockAddr>
where
P: AsRef<Path>,
{
crate::sys::unix_sockaddr(path.as_ref())
}

/// Create a `SockAddr` from the underlying storage and its length.
///
/// # Safety
Expand Down Expand Up @@ -153,6 +143,16 @@ impl SockAddr {
})
}

/// Constructs a `SockAddr` with the family `AF_UNIX` and the provided path.
///
/// Returns an error if the path is longer than `SUN_LEN`.
pub fn unix<P>(path: P) -> io::Result<SockAddr>
where
P: AsRef<Path>,
{
crate::sys::unix_sockaddr(path.as_ref())
}

/// Returns this address's family.
pub const fn family(&self) -> sa_family_t {
self.storage.ss_family
Expand Down

0 comments on commit 6e48562

Please sign in to comment.