@@ -74,26 +74,26 @@ impl<S: PageSize> fmt::Debug for PhysFrame<S> {
74
74
impl < S : PageSize > Add < u64 > for PhysFrame < S > {
75
75
type Output = Self ;
76
76
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 )
78
78
}
79
79
}
80
80
81
81
impl < S : PageSize > AddAssign < u64 > for PhysFrame < S > {
82
82
fn add_assign ( & mut self , rhs : u64 ) {
83
- * self = self . clone ( ) + rhs;
83
+ * self = * self + rhs;
84
84
}
85
85
}
86
86
87
87
impl < S : PageSize > Sub < u64 > for PhysFrame < S > {
88
88
type Output = Self ;
89
89
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 )
91
91
}
92
92
}
93
93
94
94
impl < S : PageSize > SubAssign < u64 > for PhysFrame < S > {
95
95
fn sub_assign ( & mut self , rhs : u64 ) {
96
- * self = self . clone ( ) - rhs;
96
+ * self = * self - rhs;
97
97
}
98
98
}
99
99
@@ -118,7 +118,7 @@ impl<S: PageSize> PhysFrameRange<S> {
118
118
/// Returns whether the range contains no frames.
119
119
#[ inline]
120
120
pub fn is_empty ( & self ) -> bool {
121
- ! ( self . start < self . end )
121
+ self . start >= self . end
122
122
}
123
123
}
124
124
@@ -127,7 +127,7 @@ impl<S: PageSize> Iterator for PhysFrameRange<S> {
127
127
128
128
fn next ( & mut self ) -> Option < Self :: Item > {
129
129
if self . start < self . end {
130
- let frame = self . start . clone ( ) ;
130
+ let frame = self . start ;
131
131
self . start += 1 ;
132
132
Some ( frame)
133
133
} else {
@@ -159,7 +159,7 @@ impl<S: PageSize> PhysFrameRangeInclusive<S> {
159
159
/// Returns whether the range contains no frames.
160
160
#[ inline]
161
161
pub fn is_empty ( & self ) -> bool {
162
- ! ( self . start < = self . end )
162
+ self . start > = self . end
163
163
}
164
164
}
165
165
@@ -168,7 +168,7 @@ impl<S: PageSize> Iterator for PhysFrameRangeInclusive<S> {
168
168
169
169
fn next ( & mut self ) -> Option < Self :: Item > {
170
170
if self . start <= self . end {
171
- let frame = self . start . clone ( ) ;
171
+ let frame = self . start ;
172
172
self . start += 1 ;
173
173
Some ( frame)
174
174
} else {
0 commit comments