Skip to content

Commit 729e782

Browse files
committed
implement Default for UnixCredentials on Linux
1 parent 6f68bfd commit 729e782

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
3535
(#[1252](https://github.com/nix-rust/nix/pull/1252))
3636
- Added support for `Ipv4PacketInfo` and `Ipv6PacketInfo` to `ControlMessage`.
3737
(#[1222](https://github.com/nix-rust/nix/pull/1222))
38-
- `CpuSet` now implements `Default`.
38+
- `CpuSet` and `UnixCredentials` now implement `Default`.
3939
(#[1244](https://github.com/nix-rust/nix/pull/1244))
4040

4141
### Changed

src/sys/socket/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,12 @@ cfg_if! {
221221
}
222222
}
223223

224+
impl Default for UnixCredentials {
225+
fn default() -> Self {
226+
Self::new()
227+
}
228+
}
229+
224230
impl From<libc::ucred> for UnixCredentials {
225231
fn from(cred: libc::ucred) -> Self {
226232
UnixCredentials(cred)

0 commit comments

Comments
 (0)