summaryrefslogtreecommitdiff
path: root/src/layout
diff options
context:
space:
mode:
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 (),
+ )
}
}