diff --git a/bigint/src/biguint.rs b/bigint/src/biguint.rs index ffe14e0..b2e4492 100644 --- a/bigint/src/biguint.rs +++ b/bigint/src/biguint.rs @@ -394,7 +394,7 @@ impl<'a> Add<&'a BigUint> for BigUint { } } -forward_all_scalar_binop_to_val_val!(impl Add for BigUint, add); +forward_all_scalar_binop_to_val_val_commutative!(impl Add for BigUint, add); impl Add for BigUint { type Output = BigUint; @@ -460,7 +460,7 @@ impl<'a, 'b> Mul<&'b BigUint> for &'a BigUint { } } -forward_all_scalar_binop_to_val_val!(impl Mul for BigUint, mul); +forward_all_scalar_binop_to_val_val_commutative!(impl Mul for BigUint, mul); impl Mul for BigUint { type Output = BigUint; diff --git a/bigint/src/macros.rs b/bigint/src/macros.rs index c6ebf71..92041a9 100644 --- a/bigint/src/macros.rs +++ b/bigint/src/macros.rs @@ -105,7 +105,7 @@ macro_rules! forward_ref_ref_binop_commutative { } } -macro_rules! forward_scalar_val_val_binop { +macro_rules! forward_scalar_val_val_binop_commutative { (impl $imp:ident<$scalar:ty> for $res:ty, $method: ident) => { impl $imp<$res> for $scalar { type Output = $res; @@ -118,7 +118,7 @@ macro_rules! forward_scalar_val_val_binop { } } -macro_rules! forward_scalar_val_ref_binop { +macro_rules! forward_scalar_val_ref_binop_commutative { (impl $imp:ident<$scalar:ty> for $res:ty, $method:ident) => { impl<'a> $imp<&'a $scalar> for $res { type Output = $res; @@ -140,7 +140,7 @@ macro_rules! forward_scalar_val_ref_binop { } } -macro_rules! forward_scalar_ref_val_binop { +macro_rules! forward_scalar_ref_val_binop_commutative { (impl $imp:ident<$scalar:ty> for $res:ty, $method:ident) => { impl<'a> $imp<$scalar> for &'a $res { type Output = $res; @@ -162,7 +162,7 @@ macro_rules! forward_scalar_ref_val_binop { } } -macro_rules! forward_scalar_ref_ref_binop { +macro_rules! forward_scalar_ref_ref_binop_commutative { (impl $imp:ident<$scalar:ty> for $res:ty, $method:ident) => { impl<'a, 'b> $imp<&'b $scalar> for &'a $res { type Output = $res; @@ -211,11 +211,11 @@ macro_rules! forward_all_binop_to_val_ref_commutative { }; } -macro_rules! forward_all_scalar_binop_to_val_val { +macro_rules! forward_all_scalar_binop_to_val_val_commutative { (impl $imp:ident<$scalar:ty> for $res:ty, $method:ident) => { - forward_scalar_val_val_binop!(impl $imp<$scalar> for $res, $method); - forward_scalar_val_ref_binop!(impl $imp<$scalar> for $res, $method); - forward_scalar_ref_val_binop!(impl $imp<$scalar> for $res, $method); - forward_scalar_ref_ref_binop!(impl $imp<$scalar> for $res, $method); + forward_scalar_val_val_binop_commutative!(impl $imp<$scalar> for $res, $method); + forward_scalar_val_ref_binop_commutative!(impl $imp<$scalar> for $res, $method); + forward_scalar_ref_val_binop_commutative!(impl $imp<$scalar> for $res, $method); + forward_scalar_ref_ref_binop_commutative!(impl $imp<$scalar> for $res, $method); } }