Skip to content

Commit

Permalink
Merge #1215
Browse files Browse the repository at this point in the history
1215: Remove sys::socket::addr::from_libc_sockaddr from the public API r=posborne a=asomers

This function never should've been public, since it's basically
impossible to use directly.  It's only public due to an oversight from
PR #667 .

Co-authored-by: Alan Somers <[email protected]>
  • Loading branch information
bors[bot] and asomers authored May 1, 2020
2 parents e61ae4a + 494d4f7 commit 609d429
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Removed

- Removed `sys::socket::addr::from_libc_sockaddr` from the public API.
(#[1215](https://github.com/nix-rust/nix/pull/1215))

## [0.17.0] - 3 February 2020
### Added
- Add `CLK_TCK` to `SysconfVar`
Expand Down
7 changes: 6 additions & 1 deletion src/sys/socket/addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,12 @@ impl SockAddr {
///
/// Supports only the following address families: Unix, Inet (v4 & v6), Netlink and System.
/// Returns None for unsupported families.
pub unsafe fn from_libc_sockaddr(addr: *const libc::sockaddr) -> Option<SockAddr> {
///
/// # Safety
///
/// unsafe because it takes a raw pointer as argument. The caller must
/// ensure that the pointer is valid.
pub(crate) unsafe fn from_libc_sockaddr(addr: *const libc::sockaddr) -> Option<SockAddr> {
if addr.is_null() {
None
} else {
Expand Down

0 comments on commit 609d429

Please sign in to comment.