@@ -74,26 +74,26 @@ impl<S: PageSize> fmt::Debug for PhysFrame<S> {
7474impl < S : PageSize > Add < u64 > for PhysFrame < S > {
7575 type Output = Self ;
7676 fn add ( self , rhs : u64 ) -> Self :: Output {
77- PhysFrame :: containing_address ( self . start_address ( ) + rhs * u64 :: from ( S :: SIZE ) )
77+ PhysFrame :: containing_address ( self . start_address ( ) + rhs * S :: SIZE )
7878 }
7979}
8080
8181impl < S : PageSize > AddAssign < u64 > for PhysFrame < S > {
8282 fn add_assign ( & mut self , rhs : u64 ) {
83- * self = self . clone ( ) + rhs;
83+ * self = * self + rhs;
8484 }
8585}
8686
8787impl < S : PageSize > Sub < u64 > for PhysFrame < S > {
8888 type Output = Self ;
8989 fn sub ( self , rhs : u64 ) -> Self :: Output {
90- PhysFrame :: containing_address ( self . start_address ( ) - rhs * u64 :: from ( S :: SIZE ) )
90+ PhysFrame :: containing_address ( self . start_address ( ) - rhs * S :: SIZE )
9191 }
9292}
9393
9494impl < S : PageSize > SubAssign < u64 > for PhysFrame < S > {
9595 fn sub_assign ( & mut self , rhs : u64 ) {
96- * self = self . clone ( ) - rhs;
96+ * self = * self - rhs;
9797 }
9898}
9999
@@ -118,7 +118,7 @@ impl<S: PageSize> PhysFrameRange<S> {
118118 /// Returns whether the range contains no frames.
119119 #[ inline]
120120 pub fn is_empty ( & self ) -> bool {
121- ! ( self . start < self . end )
121+ self . start >= self . end
122122 }
123123}
124124
@@ -127,7 +127,7 @@ impl<S: PageSize> Iterator for PhysFrameRange<S> {
127127
128128 fn next ( & mut self ) -> Option < Self :: Item > {
129129 if self . start < self . end {
130- let frame = self . start . clone ( ) ;
130+ let frame = self . start ;
131131 self . start += 1 ;
132132 Some ( frame)
133133 } else {
@@ -159,7 +159,7 @@ impl<S: PageSize> PhysFrameRangeInclusive<S> {
159159 /// Returns whether the range contains no frames.
160160 #[ inline]
161161 pub fn is_empty ( & self ) -> bool {
162- ! ( self . start < = self . end )
162+ self . start > = self . end
163163 }
164164}
165165
@@ -168,7 +168,7 @@ impl<S: PageSize> Iterator for PhysFrameRangeInclusive<S> {
168168
169169 fn next ( & mut self ) -> Option < Self :: Item > {
170170 if self . start <= self . end {
171- let frame = self . start . clone ( ) ;
171+ let frame = self . start ;
172172 self . start += 1 ;
173173 Some ( frame)
174174 } else {
0 commit comments