Skip to main content

crypto_bigint/limb/
bit_or.rs

1//! Limb bit or operations.
2
3use super::Limb;
4use core::ops::{BitOr, BitOrAssign};
5
6impl Limb {
7    /// Calculates `a | b`.
8    #[inline(always)]
9    #[must_use]
10    pub const fn bitor(self, rhs: Self) -> Self {
11        Limb(self.0 | rhs.0)
12    }
13}
14
15impl BitOr for Limb {
16    type Output = Limb;
17
18    fn bitor(self, rhs: Self) -> Self::Output {
19        self.bitor(rhs)
20    }
21}
22
23impl BitOr<&Self> for Limb {
24    type Output = Limb;
25
26    fn bitor(self, rhs: &Self) -> Self::Output {
27        self.bitor(*rhs)
28    }
29}
30
31impl BitOrAssign for Limb {
32    fn bitor_assign(&mut self, other: Self) {
33        *self = self.bitor(other);
34    }
35}
36
37impl BitOrAssign<&Limb> for Limb {
38    fn bitor_assign(&mut self, other: &Self) {
39        *self = self.bitor(*other);
40    }
41}