Skip to content

Commit ca1c755

Browse files
feat: impl std::ops::BitOr for Signal
1 parent f78f454 commit ca1c755

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1717
([#1959](https://github.com/nix-rust/nix/pull/1959))
1818
- Added `impl std::ops::BitOr for SigSet`.
1919
([#1959](https://github.com/nix-rust/nix/pull/1959))
20+
- Added `impl std::ops::BitOr for Signal`.
21+
([#1959](https://github.com/nix-rust/nix/pull/1959))
2022

2123
### Changed
2224

src/sys/signal.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,19 @@ impl From<Signal> for SigSet {
593593
}
594594
}
595595

596+
597+
impl std::ops::BitOr for Signal {
598+
type Output = SigSet;
599+
600+
// rhs is the "right-hand side" of the expression `a | b`
601+
fn bitor(self, rhs: Self) -> Self::Output {
602+
let mut sigset = SigSet::empty();
603+
sigset.add(self);
604+
sigset.add(rhs);
605+
sigset
606+
}
607+
}
608+
596609
impl std::ops::BitOr for SigSet {
597610
type Output = Self;
598611

0 commit comments

Comments
 (0)