From 547e7c6a304822914816efc5a0a8b386bc358296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?cel=20=F0=9F=8C=B8?= Date: Mon, 2 Dec 2024 21:49:18 +0000 Subject: [PATCH] use trait generic in push_child element builder method --- src/element.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 {