@returns {String} -- the text of the (leaf) element otherwise an empty string
(e: Element)
| 36 | |
| 37 | // @returns {String} -- the text of the (leaf) element otherwise an empty string |
| 38 | fn get_text_from_element(e: Element) -> String { |
| 39 | if e.children().len() == 1 { |
| 40 | if let ChildOfElement::Text(t) = e.children()[0] { |
| 41 | return t.text().to_string(); |
| 42 | } |
| 43 | } |
| 44 | return "".to_string(); |
| 45 | } |
| 46 | |
| 47 | #[allow(non_snake_case)] |
| 48 | // Same as 'is_tag', but for ChildOfElement |
no test coverage detected