aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2020-11-26 23:12:35 +0100
committerHarald Eilertsen <haraldei@anduin.net>2020-11-26 23:12:35 +0100
commitc961d78f209005db4200fdb5567d43e01be05a6e (patch)
treeb1d14fb1466232d5a67ef34dc869296e2a958aaf
parent0c745edddca6eb3347486b7ce9c77b0bb3de54b1 (diff)
downloadcbconv-c961d78f209005db4200fdb5567d43e01be05a6e.tar.gz
cbconv-c961d78f209005db4200fdb5567d43e01be05a6e.tar.bz2
cbconv-c961d78f209005db4200fdb5567d43e01be05a6e.zip
Simplify output of node info.
With the Node Enum, we don't need to unwrap the contents just for s debug printout.
-rw-r--r--src/main.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/main.rs b/src/main.rs
index 802d50e..6a1c37d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -356,15 +356,9 @@ where
assert_eq!(r.len(), 0);
let mut indent = 2;
for node in nodes {
- match node {
- Node::Container(name, v) => {
- println!("{1:0$}{2}, {3}", indent, " ", name, v);
- indent += 2;
- },
- Node::Leaf(name, v, nv) => {
- println!("{1:0$}{2}, {3}", indent, " ", name, v);
- println!("{1:0$}{2:?}", indent + 2, " ", nv);
- },
+ println!("{1:0$}{2:?}", indent, " ", node);
+ if let Node::Container(_, _) = node {
+ indent += 2;
}
}
},