@@ -47,24 +47,24 @@ pub trait DivRemEuclid: Sized + Div<Self, Output = Self> + Rem<Self, Output = Se
47
47
fn rem_euclid ( & self , v : & Self ) -> Self ;
48
48
}
49
49
macro_rules! div_rem_euclid_impl {
50
- ( $trait_name: ident for $( $t: ty) * ) => { $(
50
+ ( $trait_name: ident, $method : ident , $method_2 : ident for $( $t: ty) * ) => { $(
51
51
impl $trait_name for $t {
52
52
#[ inline]
53
- fn div_euclid ( & self , v: & $t) -> Self {
54
- <$t>:: div_euclid ( * self , * v)
53
+ fn $method ( & self , v: & $t) -> Self {
54
+ <$t>:: $method ( * self , * v)
55
55
}
56
56
57
57
#[ inline]
58
- fn rem_euclid ( & self , v: & $t) -> Self {
59
- <$t>:: rem_euclid ( * self , * v)
58
+ fn $method_2 ( & self , v: & $t) -> Self {
59
+ <$t>:: $method_2 ( * self , * v)
60
60
}
61
61
62
62
}
63
63
) * }
64
64
}
65
- div_rem_euclid_impl ! ( DivRemEuclid for isize usize i8 u8 i16 u16 i32 u32 i64 u64 ) ;
65
+ div_rem_euclid_impl ! ( DivRemEuclid , div_euclid , rem_euclid for isize usize i8 u8 i16 u16 i32 u32 i64 u64 ) ;
66
66
#[ cfg( has_i128) ]
67
- div_rem_euclid_impl ! ( DivRemEuclid for i128 u128 ) ;
67
+ div_rem_euclid_impl ! ( DivRemEuclid , div_euclid , rem_euclid for i128 u128 ) ;
68
68
69
69
#[ cfg( any( feature = "std" , feature = "libm" ) ) ]
70
70
impl DivRemEuclid for f32 {
@@ -117,23 +117,23 @@ pub trait CheckedDivRemEuclid: Sized + Div<Self, Output = Self> + Rem<Self, Outp
117
117
}
118
118
119
119
macro_rules! checked_div_rem_euclid_impl {
120
- ( $trait_name: ident for $( $t: ty) * ) => { $(
120
+ ( $trait_name: ident, $method : ident , $method_2 : ident for $( $t: ty) * ) => { $(
121
121
impl $trait_name for $t {
122
122
#[ inline]
123
- fn checked_div_euclid ( & self , v: & $t) -> Option <$t> {
124
- <$t>:: checked_div_euclid ( * self , * v)
123
+ fn $method ( & self , v: & $t) -> Option <$t> {
124
+ <$t>:: $method ( * self , * v)
125
125
}
126
126
127
127
#[ inline]
128
- fn checked_rem_euclid ( & self , v: & $t) -> Option <$t> {
129
- <$t>:: checked_rem_euclid ( * self , * v)
128
+ fn $method_2 ( & self , v: & $t) -> Option <$t> {
129
+ <$t>:: $method_2 ( * self , * v)
130
130
}
131
131
}
132
132
) * }
133
133
}
134
- checked_div_rem_euclid_impl ! ( CheckedDivRemEuclid for isize usize i8 u8 i16 u16 i32 u32 i64 u64 ) ;
134
+ checked_div_rem_euclid_impl ! ( CheckedDivRemEuclid , checked_div_euclid , checked_rem_euclid for isize usize i8 u8 i16 u16 i32 u32 i64 u64 ) ;
135
135
#[ cfg( has_i128) ]
136
- checked_div_rem_euclid_impl ! ( CheckedDivRemEuclid for i128 u128 ) ;
136
+ checked_div_rem_euclid_impl ! ( CheckedDivRemEuclid , checked_div_euclid , checked_rem_euclid for i128 u128 ) ;
137
137
138
138
#[ cfg( test) ]
139
139
mod tests {
0 commit comments