Skip to content

Commit d01a1ba

Browse files
committed
BUGFIX: control flow used wrong truthiness check
2 parents 4a5bb2c + e080c54 commit d01a1ba

5 files changed

Lines changed: 21 additions & 19 deletions

File tree

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* 0.2.7
2+
* BUGFIX: Fixed wrong truthiness check on control flow
13
* 0.2.6
24
* `Either` now works by doing truthiness checks on state
35
* `Backend::full_screen()` convenience function

Cargo.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "anathema"
33
edition = "2024"
4-
version = "0.2.6"
4+
version = "0.2.7"
55
license = "MIT"
66
description = "Create beautiful, easily customisable terminal applications"
77
keywords = ["tui", "terminal", "widgets", "ui", "layout"]
@@ -38,24 +38,24 @@ workspace = true
3838

3939
[workspace.package]
4040
edition = "2024"
41-
version = "0.2.6"
41+
version = "0.2.7"
4242

4343
[workspace.dependencies]
4444
bitflags = "2.4.1"
4545
crossterm = "0.28.1"
4646
unicode-width = "0.1.11"
4747
flume = "0.11.0"
4848
notify = "6.1.1"
49-
anathema-default-widgets = { path = "./anathema-default-widgets", version = "0.2.6" }
50-
anathema-backend = { path = "./anathema-backend", version = "0.2.6" }
51-
anathema-runtime = { path = "./anathema-runtime", version = "0.2.6" }
52-
anathema-state = { path = "./anathema-state", version = "0.2.6" }
53-
anathema-state-derive = { path = "./anathema-state-derive", version = "0.2.6" }
54-
anathema-store = { path = "./anathema-store", version = "0.2.6" }
55-
anathema-templates = { path = "./anathema-templates", version = "0.2.6" }
56-
anathema-widgets = { path = "./anathema-widgets", version = "0.2.6" }
57-
anathema-geometry = { path = "./anathema-geometry", version = "0.2.6" }
58-
anathema-value-resolver = { path = "./anathema-value-resolver", version = "0.2.6" }
49+
anathema-default-widgets = { path = "./anathema-default-widgets", version = "0.2.7" }
50+
anathema-backend = { path = "./anathema-backend", version = "0.2.7" }
51+
anathema-runtime = { path = "./anathema-runtime", version = "0.2.7" }
52+
anathema-state = { path = "./anathema-state", version = "0.2.7" }
53+
anathema-state-derive = { path = "./anathema-state-derive", version = "0.2.7" }
54+
anathema-store = { path = "./anathema-store", version = "0.2.7" }
55+
anathema-templates = { path = "./anathema-templates", version = "0.2.7" }
56+
anathema-widgets = { path = "./anathema-widgets", version = "0.2.7" }
57+
anathema-geometry = { path = "./anathema-geometry", version = "0.2.7" }
58+
anathema-value-resolver = { path = "./anathema-value-resolver", version = "0.2.7" }
5959

6060
[workspace]
6161
members = [

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-testutils/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ homepage = "https://github.com/togglebyte/anathema"
99
repository = "https://github.com/togglebyte/anathema"
1010

1111
[dependencies]
12-
anathema = { path = "../", version = "0.2.6" }
12+
anathema = { path = "../", version = "0.2.7" }
1313

1414
[lints]
1515
workspace = true

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)