Skip to content

Commit c4899f5

Browse files
authored
Merge pull request #125 from togglebyte/dev
BUGFIX: control flow used wrong truthiness check
2 parents 4a5bb2c + e080c54 commit c4899f5

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

anathema-store/src/slab/shared/arc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ impl<I, T> Entry<I, T> {
5555
// Try to make the entry vacant and return the value
5656
fn try_evict(&mut self, next_id: &mut Option<I>) -> Option<T> {
5757
// If the strong count is anything but 1, then return None
58-
if let Entry::Occupied(value) = self {
59-
if Arc::strong_count(value) != 1 {
60-
return None;
61-
}
58+
if let Entry::Occupied(value) = self
59+
&& Arc::strong_count(value) != 1
60+
{
61+
return None;
6262
}
6363

6464
let mut value = Entry::Pending;

anathema-widgets/src/nodes/controlflow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ impl<'bp> ControlFlow<'bp> {
2222
Change::Changed | Change::Dropped => {
2323
let Some(el) = self.elses.get_mut(branch_id as usize) else { return };
2424
let Some(cond) = el.cond.as_mut() else { return };
25-
let current = cond.as_bool();
25+
let current = cond.truthiness();
2626
cond.reload(ctx.attribute_storage);
27-
if cond.as_bool() != current {
27+
if cond.truthiness() != current {
2828
ctx.truncate_children(&mut tree);
2929
}
3030
}

0 commit comments

Comments
 (0)