Skip to content

Commit 82dc236

Browse files
committed
boolean expression can be simplified
1 parent 26c0e51 commit 82dc236

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/structures/paging/frame.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

@@ -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

src/structures/paging/page.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ pub struct PageRange<S: PageSize = Size4KiB> {
249249
impl<S: PageSize> PageRange<S> {
250250
/// Returns wether this range contains no pages.
251251
pub fn is_empty(&self) -> bool {
252-
!(self.start < self.end)
252+
self.start >= self.end
253253
}
254254
}
255255

@@ -300,7 +300,7 @@ pub struct PageRangeInclusive<S: PageSize = Size4KiB> {
300300
impl<S: PageSize> PageRangeInclusive<S> {
301301
/// Returns wether this range contains no pages.
302302
pub fn is_empty(&self) -> bool {
303-
!(self.start <= self.end)
303+
self.start >= self.end
304304
}
305305
}
306306

0 commit comments

Comments
 (0)