From 494d4f7e3ccb84cbb4e120e53a9c08ff551b64f9 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sun, 12 Apr 2020 14:40:45 -0600 Subject: Remove sys::socket::addr::from_libc_sockaddr from the public API 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 . --- CHANGELOG.md | 3 +++ src/sys/socket/addr.rs | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d565a9a..26e5a3df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` diff --git a/src/sys/socket/addr.rs b/src/sys/socket/addr.rs index 7037ae47..27883254 100644 --- a/src/sys/socket/addr.rs +++ b/src/sys/socket/addr.rs @@ -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 { + /// + /// # 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 { if addr.is_null() { None } else { -- cgit v1.2.3