#[doc(hidden)]
#[macro_export]
macro_rules! _parse_assignment_op {
(+=, $($t:tt)+) => ($crate::_impl_assignment_op_internal!(ops, AddAssign, add_assign, $($t)+););
(-=, $($t:tt)+) => ($crate::_impl_assignment_op_internal!(ops, SubAssign, sub_assign, $($t)+););
(*=, $($t:tt)+) => ($crate::_impl_assignment_op_internal!(ops, MulAssign, mul_assign, $($t)+););
(/=, $($t:tt)+) => ($crate::_impl_assignment_op_internal!(ops, DivAssign, div_assign, $($t)+););
(%=, $($t:tt)+) => ($crate::_impl_assignment_op_internal!(ops, RemAssign, rem_assign, $($t)+););
(&=, $($t:tt)+) => ($crate::_impl_assignment_op_internal!(ops, BitAndAssign, bitand_assign, $($t)+););
(|=, $($t:tt)+) => ($crate::_impl_assignment_op_internal!(ops, BitOrAssign, bitor_assign, $($t)+););
(^=, $($t:tt)+) => ($crate::_impl_assignment_op_internal!(ops, BitXorAssign, bitxor_assign, $($t)+););
(<<=, $($t:tt)+) => ($crate::_impl_assignment_op_internal!(ops, ShlAssign, shl_assign, $($t)+););
(>>=, $($t:tt)+) => ($crate::_impl_assignment_op_internal!(ops, ShrAssign, shr_assign, $($t)+););
}
#[doc(hidden)]
#[macro_export]
macro_rules! _impl_assignment_op_internal {
($path:ident, $ops_trait:ident, $ops_fn:ident, $lhs:ty, &$rhs:ty, $lhs_i:ident, $rhs_i:ident, $body:block) => {
impl $path::$ops_trait<&$rhs> for $lhs {
#[inline]
fn $ops_fn(&mut self, $rhs_i: &$rhs) {
let mut $lhs_i = self;
$body
}
}
impl $path::$ops_trait<&$rhs> for &mut $lhs {
#[inline]
fn $ops_fn(&mut self, $rhs_i: &$rhs) {
let mut $lhs_i = self;
$body
}
}
};
($path:ident, $ops_trait:ident, $ops_fn:ident, $lhs:ty, $rhs:ty, $lhs_i:ident, $rhs_i:ident, $body:block) => {
impl $path::$ops_trait<$rhs> for $lhs {
#[inline]
fn $ops_fn(&mut self, $rhs_i: $rhs) {
let mut $lhs_i = self;
$body
}
}
impl $path::$ops_trait<$rhs> for &mut $lhs {
#[inline]
fn $ops_fn(&mut self, $rhs_i: $rhs) {
let mut $lhs_i = self;
$body
}
}
};
}