Skip to content

Commit a24a74f

Browse files
feat: impl std::ops::BitOr for Signal
1 parent 3f36264 commit a24a74f

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ 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 From<Signal> for SigSet`.
21+
([#1959](https://github.com/nix-rust/nix/pull/1959))
22+
- Added `impl std::ops::BitOr for SigSet`.
23+
([#1959](https://github.com/nix-rust/nix/pull/1959))
24+
- Added `impl std::ops::BitOr for Signal`.
25+
([#1959](https://github.com/nix-rust/nix/pull/1959))
2026

2127
### Changed
2228

src/sys/signal.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,19 @@ impl From<Signal> for SigSet {
612612
}
613613
}
614614

615+
616+
impl std::ops::BitOr for Signal {
617+
type Output = SigSet;
618+
619+
// rhs is the "right-hand side" of the expression `a | b`
620+
fn bitor(self, rhs: Self) -> Self::Output {
621+
let mut sigset = SigSet::empty();
622+
sigset.add(self);
623+
sigset.add(rhs);
624+
sigset
625+
}
626+
}
627+
615628
impl std::ops::BitOr for SigSet {
616629
type Output = Self;
617630

0 commit comments

Comments
 (0)