Skip to content

Commit 2e14fd4

Browse files
committed
feat: make Node impl Default and rename NULL to EMPTY
1 parent 1c423d8 commit 2e14fd4

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ resolver = "2"
1313
license = "MIT"
1414
readme = "README.md"
1515
repository = "https://github.com/vidhanio/html-node"
16-
version = "0.1.18"
16+
version = "0.2.0"

html-node-core/src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub enum Node {
7575

7676
impl Node {
7777
/// A [`Node::Fragment`] with no children.
78-
pub const NULL: Self = Self::Fragment(Fragment {
78+
pub const EMPTY: Self = Self::Fragment(Fragment {
7979
children: Vec::new(),
8080
});
8181

@@ -111,6 +111,12 @@ impl Display for Node {
111111
}
112112
}
113113

114+
impl Default for Node {
115+
fn default() -> Self {
116+
Self::EMPTY
117+
}
118+
}
119+
114120
/// A comment.
115121
///
116122
/// ```html

0 commit comments

Comments
 (0)