aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/tree.rs
diff options
context:
space:
mode:
authorIvan Tham2021-06-07 14:34:19 +0000
committerBlaž Hrastnik2021-06-10 13:00:08 +0000
commit7cc13fefe9bd09ea778a0eb8c26bf133e6ad2476 (patch)
tree764c662e47f12134a8a7f20211573243100777a5 /helix-view/src/tree.rs
parent1a3a92463405fdd4738fbdbfda212aef58a2919d (diff)
Derive debug without feature
Note that this also removed those `finish_non_exhaustive()`.
Diffstat (limited to 'helix-view/src/tree.rs')
-rw-r--r--helix-view/src/tree.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/helix-view/src/tree.rs b/helix-view/src/tree.rs
index b5eb5d87..a0c466d9 100644
--- a/helix-view/src/tree.rs
+++ b/helix-view/src/tree.rs
@@ -4,7 +4,7 @@ use tui::layout::Rect;
// the dimensions are recomputed on windo resize/tree change.
//
-#[cfg_attr(feature = "debug", derive(Debug))]
+#[derive(Debug)]
pub struct Tree {
root: ViewId,
// (container, index inside the container)
@@ -18,13 +18,13 @@ pub struct Tree {
stack: Vec<(ViewId, Rect)>,
}
-#[cfg_attr(feature = "debug", derive(Debug))]
+#[derive(Debug)]
pub struct Node {
parent: ViewId,
content: Content,
}
-#[cfg_attr(feature = "debug", derive(Debug))]
+#[derive(Debug)]
pub enum Content {
View(Box<View>),
Container(Box<Container>),
@@ -48,15 +48,14 @@ impl Node {
// TODO: screen coord to container + container coordinate helpers
-#[cfg_attr(feature = "debug", derive(Debug))]
-#[derive(PartialEq, Eq)]
+#[derive(Debug, PartialEq, Eq)]
pub enum Layout {
Horizontal,
Vertical,
// could explore stacked/tabbed
}
-#[cfg_attr(feature = "debug", derive(Debug))]
+#[derive(Debug)]
pub struct Container {
layout: Layout,
children: Vec<ViewId>,
@@ -437,7 +436,7 @@ impl Tree {
}
}
-#[cfg_attr(feature = "debug", derive(Debug))]
+#[derive(Debug)]
pub struct Traverse<'a> {
tree: &'a Tree,
stack: Vec<ViewId>, // TODO: reuse the one we use on update