Skip to content

Commit 267c113

Browse files
committed
remove comp and ord for ComponentEntry as it seemed to be unused
1 parent 9feacca commit 267c113

File tree

5 files changed

+7
-29
lines changed

5 files changed

+7
-29
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
* 0.2.10
22
* BUGFIX: `on_mount` is now called after the children are generated
33
* BUGFIX: `on_tick` is now run before the cycle call
4+
* BUGFIX: `expand` would make the constraints tight, this is no longer the
5+
case
46
* 0.2.9
57
* New function: truncate
68
* New border style: "rounded"

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ documentation = "https://togglebyte.github.io/anathema-guide/"
1111
homepage = "https://github.com/togglebyte/anathema"
1212
repository = "https://github.com/togglebyte/anathema"
1313
publish = true
14+
rust-version = "1.88"
1415

1516
[dependencies]
1617
anathema-backend = { workspace = true }
@@ -83,6 +84,7 @@ should_implement_trait = "allow"
8384
type_complexity = "allow"
8485
too_many_arguments = "allow"
8586
wrong_self_convention = "allow"
87+
collapsible_if = "allow"
8688

8789
[package.metadata.release]
8890
shared-version = true

anathema-default-widgets/src/layout/expand.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ pub fn layout_all_expansions<'bp>(
8585
let mut constraints = Constraints::new(sub_size, constraints.max_height());
8686

8787
// Ensure that the rounding doesn't push the constraint outside of the max width
88-
constraints.min_width = constraints.max_width();
88+
constraints.min_width = constraints.min_width.min(constraints.max_width());
8989
constraints
9090
}
9191
Axis::Vertical => {
9292
let mut constraints = Constraints::new(constraints.max_width(), sub_size);
9393

9494
// Ensure that the rounding doesn't push the constraint outside of the max height
95-
constraints.min_height = constraints.max_height();
95+
constraints.min_height = constraints.min_height.min(constraints.max_height());
9696
constraints
9797
}
9898
};

anathema-widgets/src/nodes/eval.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,7 @@ impl Evaluator for ComponentEval {
303303
.ok_or_else(|| ctx.error(ErrorKind::TreeTransactionFailed))?;
304304
ctx.new_components.push((widget_id, state_id));
305305

306-
let path = tree.path(widget_id);
307-
ctx.components
308-
.push(path, component_id, widget_id, state_id, accept_ticks);
306+
ctx.components.push(component_id, widget_id, state_id, accept_ticks);
309307

310308
Ok(())
311309
}

anathema-widgets/src/widget/mod.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use std::any::Any;
2-
use std::cmp::Ordering;
32
use std::fmt::{self, Debug};
43
use std::ops::ControlFlow;
54

@@ -39,27 +38,6 @@ pub struct CompEntry {
3938
pub accept_ticks: bool,
4039

4140
component_id: ComponentBlueprintId,
42-
path: Box<[u16]>,
43-
}
44-
45-
impl PartialOrd for CompEntry {
46-
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
47-
Some(self.path.cmp(&other.path))
48-
}
49-
}
50-
51-
impl Ord for CompEntry {
52-
fn cmp(&self, other: &Self) -> Ordering {
53-
self.path.cmp(&other.path)
54-
}
55-
}
56-
57-
impl Eq for CompEntry {}
58-
59-
impl PartialEq for CompEntry {
60-
fn eq(&self, other: &Self) -> bool {
61-
self.path.eq(&other.path)
62-
}
6341
}
6442

6543
/// Store a list of components currently in the tree
@@ -74,14 +52,12 @@ impl Components {
7452

7553
pub fn push(
7654
&mut self,
77-
path: Box<[u16]>,
7855
component_id: ComponentBlueprintId,
7956
widget_id: WidgetId,
8057
state_id: StateId,
8158
accept_ticks: bool,
8259
) {
8360
let entry = CompEntry {
84-
path,
8561
component_id,
8662
widget_id,
8763
state_id,

0 commit comments

Comments
 (0)