summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2022-10-12 10:46:23 +0200
committerAram Drevekenin <aram@poor.dev>2022-10-12 10:46:23 +0200
commit28893d790167c11fbaf04c6e708bb6069246a14e (patch)
tree48cd601f9c5a7b2894daa30177479c3b34fea9c0
parenta9486ce773ece2e998f25d9b63e1257efe55c95b (diff)
style(fmt): rustfmt
-rw-r--r--zellij-utils/src/kdl/kdl_layout_parser.rs25
1 files changed, 19 insertions, 6 deletions
diff --git a/zellij-utils/src/kdl/kdl_layout_parser.rs b/zellij-utils/src/kdl/kdl_layout_parser.rs
index 9c4adb89f..cade1bdda 100644
--- a/zellij-utils/src/kdl/kdl_layout_parser.rs
+++ b/zellij-utils/src/kdl/kdl_layout_parser.rs
@@ -420,7 +420,10 @@ impl<'a> KdlLayoutParser<'a> {
if let Some(children) = kdl_children_nodes!(kdl_node) {
for child in children {
let child_node_name = kdl_name!(child);
- if child_node_name == "pane" || child_node_name == "children" || child_node_name == "tab" {
+ if child_node_name == "pane"
+ || child_node_name == "children"
+ || child_node_name == "tab"
+ {
return true;
} else if child_node_name == "children" {
return true;
@@ -484,13 +487,20 @@ impl<'a> KdlLayoutParser<'a> {
}
Ok(())
}
- fn assert_no_mixed_children_and_properties(&self, kdl_node: &KdlNode) -> Result<(), ConfigError> {
- let has_borderless_prop = kdl_get_bool_property_or_child_value_with_error!(kdl_node, "borderless").is_some();
- let has_focus_prop = kdl_get_bool_property_or_child_value_with_error!(kdl_node, "focus").is_some();
+ fn assert_no_mixed_children_and_properties(
+ &self,
+ kdl_node: &KdlNode,
+ ) -> Result<(), ConfigError> {
+ let has_borderless_prop =
+ kdl_get_bool_property_or_child_value_with_error!(kdl_node, "borderless").is_some();
+ let has_focus_prop =
+ kdl_get_bool_property_or_child_value_with_error!(kdl_node, "focus").is_some();
let has_run_prop = self.parse_command_or_plugin_block(kdl_node)?.is_some();
let has_nested_nodes_or_children_block = self.has_child_panes_tabs_or_templates(kdl_node);
- if has_nested_nodes_or_children_block && (has_borderless_prop || has_focus_prop || has_run_prop) {
+ if has_nested_nodes_or_children_block
+ && (has_borderless_prop || has_focus_prop || has_run_prop)
+ {
let mut offending_nodes = vec![];
if has_borderless_prop {
offending_nodes.push("borderless");
@@ -502,7 +512,10 @@ impl<'a> KdlLayoutParser<'a> {
offending_nodes.push("command/plugin");
}
Err(ConfigError::new_kdl_error(
- format!("Cannot have both properties ({}) and nested children", offending_nodes.join(", ")),
+ format!(
+ "Cannot have both properties ({}) and nested children",
+ offending_nodes.join(", ")
+ ),
kdl_node.span().offset(),
kdl_node.span().len(),
))