Skip to content

Commit

Permalink
Implement Default for FdSet
Browse files Browse the repository at this point in the history
  • Loading branch information
asomers committed Aug 19, 2019
1 parent 4dca1b7 commit 97f4d68
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased] - ReleaseDate
### Added

- Implemented `Default` for `FdSet`
([#1107](https://github.com/nix-rust/nix/pull/1107))

- Added `NixPath::is_empty`.
([#1107](https://github.com/nix-rust/nix/pull/1107))

Expand Down
6 changes: 6 additions & 0 deletions src/sys/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ impl FdSet {
}
}

impl Default for FdSet {
fn default() -> Self {
Self::new()
}
}

/// Monitors file descriptors for readiness
///
/// Returns the total number of ready file descriptors in all sets. The sets are changed so that all
Expand Down
2 changes: 2 additions & 0 deletions src/sys/socket/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ impl<T> CmsgSpace<T> {
/// Create a CmsgSpace<T>. The structure is used only for space, so
/// the fields are uninitialized.
#[deprecated( since="0.14.0", note="Use the cmsg_space! macro instead")]
// It's deprecated anyway; no sense adding Default
#[allow(clippy::new_without_default)]
pub fn new() -> Self {
// Safe because the fields themselves aren't accessible.
unsafe { mem::uninitialized() }
Expand Down

0 comments on commit 97f4d68

Please sign in to comment.