MCPcopy Create free account
hub / github.com/d0iasm/saba / pop_current_node

Method pop_current_node

core/src/renderer/html/parser.rs:156–168  ·  view source on GitHub ↗

Returns true if the current node's kind is same as NodeKind::Element:: .

(&mut self, element_kind: ElementKind)

Source from the content-addressed store, hash-verified

154
155 /// Returns true if the current node's kind is same as NodeKind::Element::<element_kind>.
156 fn pop_current_node(&mut self, element_kind: ElementKind) -> bool {
157 let current = match self.stack_of_open_elements.last() {
158 Some(n) => n,
159 None => return false,
160 };
161
162 if current.borrow().element_kind() == Some(element_kind) {
163 self.stack_of_open_elements.pop();
164 return true;
165 }
166
167 false
168 }
169
170 /// Pops nodes until a node with `element_kind` comes.
171 fn pop_until(&mut self, element_kind: ElementKind) {

Callers 1

construct_treeMethod · 0.80

Calls 1

element_kindMethod · 0.80

Tested by

no test coverage detected