@@ -151,8 +151,8 @@ where T: Copy + Clone + Zero + PartialOrd + PartialEq + Add<T, Output=T> + Sub<T
151151 let lower_right_x = min ( self . max_x ( ) , other. max_x ( ) ) ;
152152 let lower_right_y = min ( self . max_y ( ) , other. max_y ( ) ) ;
153153
154- Some ( TypedRect :: new ( upper_left. clone ( ) , TypedSize2D :: new ( lower_right_x - upper_left. x ,
155- lower_right_y - upper_left. y ) ) )
154+ Some ( TypedRect :: new ( upper_left, TypedSize2D :: new ( lower_right_x - upper_left. x ,
155+ lower_right_y - upper_left. y ) ) )
156156 }
157157
158158 /// Translates the rect by a vector.
@@ -203,7 +203,7 @@ where T: Copy + Clone + Zero + PartialOrd + PartialEq + Add<T, Output=T> + Sub<T
203203
204204 #[ inline]
205205 pub fn bottom_left ( & self ) -> TypedPoint2D < T , U > {
206- TypedPoint2D :: new ( self . origin . x . clone ( ) , self . max_y ( ) )
206+ TypedPoint2D :: new ( self . origin . x , self . max_y ( ) )
207207 }
208208
209209 #[ inline]
@@ -222,10 +222,10 @@ where T: Copy + Clone + PartialOrd + Add<T, Output=T> + Sub<T, Output=T> + Zero
222222 #[ inline]
223223 pub fn union ( & self , other : & TypedRect < T , U > ) -> TypedRect < T , U > {
224224 if self . size == Zero :: zero ( ) {
225- return other. clone ( ) ;
225+ return * other;
226226 }
227227 if other. size == Zero :: zero ( ) {
228- return self . clone ( ) ;
228+ return * self ;
229229 }
230230
231231 let upper_left = TypedPoint2D :: new ( min ( self . min_x ( ) , other. min_x ( ) ) ,
@@ -296,15 +296,15 @@ impl<T: Copy + Mul<T, Output=T>, U1, U2> Mul<ScaleFactor<T, U1, U2>> for TypedRe
296296 type Output = TypedRect < T , U2 > ;
297297 #[ inline]
298298 fn mul ( self , scale : ScaleFactor < T , U1 , U2 > ) -> TypedRect < T , U2 > {
299- TypedRect :: new ( self . origin * scale. clone ( ) , self . size * scale. clone ( ) )
299+ TypedRect :: new ( self . origin * scale, self . size * scale)
300300 }
301301}
302302
303303impl < T : Copy + Div < T , Output =T > , U1 , U2 > Div < ScaleFactor < T , U1 , U2 > > for TypedRect < T , U2 > {
304304 type Output = TypedRect < T , U1 > ;
305305 #[ inline]
306306 fn div ( self , scale : ScaleFactor < T , U1 , U2 > ) -> TypedRect < T , U1 > {
307- TypedRect :: new ( self . origin / scale. clone ( ) , self . size / scale. clone ( ) )
307+ TypedRect :: new ( self . origin / scale, self . size / scale)
308308 }
309309}
310310
0 commit comments