diff options
author | Alan Somers <asomers@gmail.com> | 2020-05-16 16:55:59 -0600 |
---|---|---|
committer | Alan Somers <asomers@gmail.com> | 2020-06-27 17:34:17 -0600 |
commit | 6f68bfdf0ea6166733f655cde48ad7125f9e31e0 (patch) | |
tree | 3c3521b88f3bbb6c46969f96b313ddf821ad85a8 | |
parent | d6f04717ba3cca1b1b13db5e6d10e6fbe34e96c7 (diff) | |
download | nix-6f68bfdf0ea6166733f655cde48ad7125f9e31e0.zip |
implement `Default` for `CpuSet`.
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | src/sched.rs | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 548bc0b6..17bb1486 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,8 @@ 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`. + (#[1244](https://github.com/nix-rust/nix/pull/1244)) ### Changed - Changed `fallocate` return type from `c_int` to `()` (#[1201](https://github.com/nix-rust/nix/pull/1201)) diff --git a/src/sched.rs b/src/sched.rs index 064deb8c..b6601ca4 100644 --- a/src/sched.rs +++ b/src/sched.rs @@ -100,6 +100,12 @@ mod sched_linux_like { } } + impl Default for CpuSet { + fn default() -> Self { + Self::new() + } + } + /// `sched_setaffinity` set a thread's CPU affinity mask /// ([`sched_setaffinity(2)`](http://man7.org/linux/man-pages/man2/sched_setaffinity.2.html)) /// |