Skip to content

Commit 5abe0ea

Browse files
feat: impl std::ops::BitOr for Signal
1 parent 202d182 commit 5abe0ea

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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)