We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6642535 commit 17b4ae4Copy full SHA for 17b4ae4
src/loader.rs
@@ -144,10 +144,7 @@ where
144
if node.1 > 0 {
145
self.anchor_map.insert(node.1, node.0.clone());
146
}
147
- if self.doc_stack.is_empty() {
148
- self.doc_stack.push(node);
149
- } else {
150
- let parent = self.doc_stack.last_mut().unwrap();
+ if let Some(parent) = self.doc_stack.last_mut() {
151
let parent_node = &mut parent.0;
152
if parent_node.is_array() {
153
parent_node.array_mut().push(node.0);
@@ -162,6 +159,8 @@ where
162
159
hash.insert(cur_key.take(), node.0);
163
160
164
161
+ } else {
+ self.doc_stack.push(node);
165
166
167
0 commit comments