diff --git a/src/element.rs b/src/element.rs index 1f78419..3f4bee3 100644 --- a/src/element.rs +++ b/src/element.rs @@ -482,8 +482,8 @@ impl ElementBuilder { self } - pub fn push_child(mut self, child: ElementBuilder) -> Self { - self.content.push(ContentBuilder::Element(child)); + pub fn push_child(mut self, child: impl IntoElement) -> Self { + self.content.push(ContentBuilder::Element(child.builder())); self } @@ -513,7 +513,7 @@ impl ElementBuilder { } } - pub fn push_child_opt(self, child: Option) -> Self { + pub fn push_child_opt(self, child: Option) -> Self { if let Some(child) = child { self.push_child(child) } else {