Skip to content

Commit 1893300

Browse files
committed
Derive Default impl of SpecialElementData
1 parent 2a46943 commit 1893300

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

packages/blitz-dom/src/node.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ impl TextInputData {
676676
}
677677

678678
/// Heterogeneous data that depends on the element's type.
679-
#[derive(Clone)]
679+
#[derive(Clone, Default)]
680680
pub enum SpecialElementData {
681681
/// An \<img\> element's image data
682682
Image(Box<ImageData>),
@@ -689,6 +689,7 @@ pub enum SpecialElementData {
689689
/// Checkbox checked state
690690
CheckboxInput(bool),
691691
/// No data (for nodes that don't need any node-specific data)
692+
#[default]
692693
None,
693694
}
694695

@@ -715,12 +716,6 @@ impl std::fmt::Debug for SpecialElementData {
715716
}
716717
}
717718

718-
impl Default for SpecialElementData {
719-
fn default() -> Self {
720-
Self::None
721-
}
722-
}
723-
724719
#[derive(Clone)]
725720
pub struct ListItemLayout {
726721
pub marker: Marker,

0 commit comments

Comments
 (0)