@@ -34,7 +34,7 @@ impl Beats {
34
34
35
35
/// Return the number of beats.
36
36
#[ inline]
37
- pub fn beats ( & self ) -> NumDiv { let Beats ( num) = * self ; num }
37
+ pub fn beats ( & self ) -> NumDiv { let Self ( num) = * self ; num }
38
38
39
39
/// Convert to the equivalent duration as a number of Bars.
40
40
#[ inline]
@@ -82,84 +82,84 @@ impl Beats {
82
82
83
83
impl From < NumDiv > for Beats {
84
84
fn from ( n : NumDiv ) -> Self {
85
- Beats ( n)
85
+ Self ( n)
86
86
}
87
87
}
88
88
89
89
impl Add for Beats {
90
- type Output = Beats ;
90
+ type Output = Self ;
91
91
#[ inline]
92
- fn add ( self , rhs : Beats ) -> Beats {
93
- Beats ( self . beats ( ) + rhs. beats ( ) )
92
+ fn add ( self , rhs : Self ) -> Self {
93
+ Self ( self . beats ( ) + rhs. beats ( ) )
94
94
}
95
95
}
96
96
97
97
impl Sub for Beats {
98
- type Output = Beats ;
98
+ type Output = Self ;
99
99
#[ inline]
100
- fn sub ( self , rhs : Beats ) -> Beats {
101
- Beats ( self . beats ( ) - rhs. beats ( ) )
100
+ fn sub ( self , rhs : Self ) -> Self {
101
+ Self ( self . beats ( ) - rhs. beats ( ) )
102
102
}
103
103
}
104
104
105
105
impl Mul for Beats {
106
- type Output = Beats ;
106
+ type Output = Self ;
107
107
#[ inline]
108
- fn mul ( self , rhs : Beats ) -> Beats {
109
- Beats ( self . beats ( ) * rhs. beats ( ) )
108
+ fn mul ( self , rhs : Self ) -> Self {
109
+ Self ( self . beats ( ) * rhs. beats ( ) )
110
110
}
111
111
}
112
112
113
113
impl Div for Beats {
114
- type Output = Beats ;
114
+ type Output = Self ;
115
115
#[ inline]
116
- fn div ( self , rhs : Beats ) -> Beats {
117
- Beats ( self . beats ( ) / rhs. beats ( ) )
116
+ fn div ( self , rhs : Self ) -> Self {
117
+ Self ( self . beats ( ) / rhs. beats ( ) )
118
118
}
119
119
}
120
120
121
121
impl Rem for Beats {
122
- type Output = Beats ;
122
+ type Output = Self ;
123
123
#[ inline]
124
- fn rem ( self , rhs : Beats ) -> Beats {
125
- Beats ( self . beats ( ) % rhs. beats ( ) )
124
+ fn rem ( self , rhs : Self ) -> Self {
125
+ Self ( self . beats ( ) % rhs. beats ( ) )
126
126
}
127
127
}
128
128
129
129
impl Neg for Beats {
130
- type Output = Beats ;
130
+ type Output = Self ;
131
131
#[ inline]
132
- fn neg ( self ) -> Beats {
133
- Beats ( -self . beats ( ) )
132
+ fn neg ( self ) -> Self {
133
+ Self ( -self . beats ( ) )
134
134
}
135
135
}
136
136
137
137
impl AddAssign for Beats {
138
- fn add_assign ( & mut self , rhs : Beats ) {
138
+ fn add_assign ( & mut self , rhs : Self ) {
139
139
* self = * self + rhs;
140
140
}
141
141
}
142
142
143
143
impl SubAssign for Beats {
144
- fn sub_assign ( & mut self , rhs : Beats ) {
144
+ fn sub_assign ( & mut self , rhs : Self ) {
145
145
* self = * self - rhs;
146
146
}
147
147
}
148
148
149
149
impl MulAssign for Beats {
150
- fn mul_assign ( & mut self , rhs : Beats ) {
150
+ fn mul_assign ( & mut self , rhs : Self ) {
151
151
* self = * self * rhs;
152
152
}
153
153
}
154
154
155
155
impl DivAssign for Beats {
156
- fn div_assign ( & mut self , rhs : Beats ) {
156
+ fn div_assign ( & mut self , rhs : Self ) {
157
157
* self = * self / rhs;
158
158
}
159
159
}
160
160
161
161
impl RemAssign for Beats {
162
- fn rem_assign ( & mut self , rhs : Beats ) {
162
+ fn rem_assign ( & mut self , rhs : Self ) {
163
163
* self = * self % rhs;
164
164
}
165
165
}
@@ -174,10 +174,10 @@ impl ToPrimitive for Beats {
174
174
}
175
175
176
176
impl FromPrimitive for Beats {
177
- fn from_u64 ( n : u64 ) -> Option < Beats > {
178
- Some ( Beats ( n as NumDiv ) )
177
+ fn from_u64 ( n : u64 ) -> Option < Self > {
178
+ Some ( Self ( n as NumDiv ) )
179
179
}
180
- fn from_i64 ( n : i64 ) -> Option < Beats > {
181
- Some ( Beats ( n as NumDiv ) )
180
+ fn from_i64 ( n : i64 ) -> Option < Self > {
181
+ Some ( Self ( n as NumDiv ) )
182
182
}
183
183
}
0 commit comments