diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2020-11-26 23:12:35 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2020-11-26 23:12:35 +0100 |
commit | c961d78f209005db4200fdb5567d43e01be05a6e (patch) | |
tree | b1d14fb1466232d5a67ef34dc869296e2a958aaf /src | |
parent | 0c745edddca6eb3347486b7ce9c77b0bb3de54b1 (diff) | |
download | cbconv-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.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 12 |
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; } } }, |