Skip to content

Commit

Permalink
Remove sys::socket::addr::from_libc_sockaddr from the public API
Browse files Browse the repository at this point in the history
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 .
  • Loading branch information
asomers committed Apr 12, 2020
1 parent b5ee610 commit 494d4f7
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 @@ -31,6 +31,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 494d4f7

Please sign in to comment.