From d45f7024584abafdd9a6b6dbc733f4688196532f Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Thu, 8 Jul 2021 23:07:51 +0200 Subject: [PATCH] Add assertion about our assumption that root's children must be outputs --- src/layout.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/layout.rs b/src/layout.rs index 4697790..061b60f 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -30,6 +30,16 @@ pub fn auto_tile(layout: &config::Layout) { .unwrap(); for output in &tree.nodes { println!("output: {:?}", output.name); + + // Assert our assumption that all children of the tree's root + // must be outputs. + if output.node_type != s::NodeType::Output { + panic!( + "Child of Root is no Output but a {:?}", + output.node_type + ); + } + let output_width = output.rect.width; let min_window_width = &config_map .as_ref()