Skip to content

Commit e4c6ce6

Browse files
feat: impl From<Signal> for SigSet
1 parent ea88824 commit e4c6ce6

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ This project adheres to [Semantic Versioning](https://semver.org/).
99
- Fix `SigSet` incorrect implementation of `Eq`, `PartialEq` and `Hash`
1010
([#1946](https://github.com/nix-rust/nix/pull/1946))
1111

12+
### Added
13+
14+
- Added `impl From<Signal> for SigSet`.
15+
([#1959](https://github.com/nix-rust/nix/pull/1959))
16+
1217
### Changed
1318

1419
- The following APIs now take an implementation of `AsFd` rather than a

src/sys/signal.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,14 @@ impl SigSet {
604604
}
605605
}
606606

607+
impl From<Signal> for SigSet {
608+
fn from(signal: Signal) -> SigSet {
609+
let mut sigset = SigSet::empty();
610+
sigset.add(signal);
611+
sigset
612+
}
613+
}
614+
607615
impl AsRef<libc::sigset_t> for SigSet {
608616
fn as_ref(&self) -> &libc::sigset_t {
609617
&self.sigset

0 commit comments

Comments
 (0)