Skip to content

Commit 8af1e89

Browse files
committed
fix: text can be null on constructor
1 parent 869af33 commit 8af1e89

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,11 @@ impl Node {
4141
) -> PyResult<Self> {
4242
let _attrs = attrs.unwrap_or(HashMap::new());
4343
let _children = children.unwrap_or(Vec::new());
44-
let _text = text.unwrap_or(String::new());
4544
Ok(Node {
4645
name,
4746
attrs: _attrs,
4847
children: _children,
49-
text: Some(_text),
48+
text,
5049
})
5150
}
5251
fn __to_string(&self, spacing: Option<u8>) -> String {

0 commit comments

Comments
 (0)