summaryrefslogtreecommitdiff
path: root/src/layout
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-12-30 11:37:11 +0100
committerLaurenz <laurmaedje@gmail.com>2021-12-30 12:00:12 +0100
commitf5dcb84e36a38182218c7f907b861b12d2bd2c1c (patch)
tree1fce04fb53d2ad5b61f5f3151e43d80e2684e579 /src/layout
parentfef55025177ea4f248e61b68fab365bfbc0e47fb (diff)
Make clippy a bit happier
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/incremental.rs24
-rw-r--r--src/layout/mod.rs5
2 files changed, 12 insertions, 17 deletions
diff --git a/src/layout/incremental.rs b/src/layout/incremental.rs
index 60b198ff..4c046051 100644
--- a/src/layout/incremental.rs
+++ b/src/layout/incremental.rs
@@ -377,22 +377,14 @@ pub struct PatternProperties {
impl PatternProperties {
/// Check if it is vital to keep an entry based on its properties.
pub fn must_keep(&self) -> bool {
- if self.top_level && !self.mature {
- // Keep an undo stack.
- true
- } else if self.all_zeros && !self.mature {
- // Keep the most recently created items, even if they have not yet
- // been used.
- true
- } else if self.multi_use && !self.abandoned {
- true
- } else if self.hit {
- true
- } else if self.sparse {
- true
- } else {
- false
- }
+ // Keep an undo stack.
+ (self.top_level && !self.mature)
+ // Keep the most recently created items, even if they have not yet
+ // been used.
+ || (self.all_zeros && !self.mature)
+ || (self.multi_use && !self.abandoned)
+ || self.hit
+ || self.sparse
}
}
diff --git a/src/layout/mod.rs b/src/layout/mod.rs
index 114e7491..4c982bb8 100644
--- a/src/layout/mod.rs
+++ b/src/layout/mod.rs
@@ -282,7 +282,10 @@ impl Debug for PackedNode {
impl PartialEq for PackedNode {
fn eq(&self, other: &Self) -> bool {
- Rc::as_ptr(&self.node) as *const () == Rc::as_ptr(&other.node) as *const ()
+ std::ptr::eq(
+ Rc::as_ptr(&self.node) as *const (),
+ Rc::as_ptr(&other.node) as *const (),
+ )
}
}