diff options
author | Alan Somers <asomers@gmail.com> | 2020-05-16 17:16:48 -0600 |
---|---|---|
committer | Alan Somers <asomers@gmail.com> | 2020-06-27 17:36:45 -0600 |
commit | 729e7828263fec48d80ef6cc68b14b96da0206e1 (patch) | |
tree | 163178b86a0e4c3ce550f19848f138e4ffb65823 | |
parent | 6f68bfdf0ea6166733f655cde48ad7125f9e31e0 (diff) | |
download | nix-729e7828263fec48d80ef6cc68b14b96da0206e1.zip |
implement Default for UnixCredentials on Linux
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | src/sys/socket/mod.rs | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 17bb1486..e0dd925b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,7 +35,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). (#[1252](https://github.com/nix-rust/nix/pull/1252)) - Added support for `Ipv4PacketInfo` and `Ipv6PacketInfo` to `ControlMessage`. (#[1222](https://github.com/nix-rust/nix/pull/1222)) -- `CpuSet` now implements `Default`. +- `CpuSet` and `UnixCredentials` now implement `Default`. (#[1244](https://github.com/nix-rust/nix/pull/1244)) ### Changed diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index 41bc7aa9..d9b94f07 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -221,6 +221,12 @@ cfg_if! { } } + impl Default for UnixCredentials { + fn default() -> Self { + Self::new() + } + } + impl From<libc::ucred> for UnixCredentials { fn from(cred: libc::ucred) -> Self { UnixCredentials(cred) |