use trait generic in push_child element builder method
This commit is contained in:
parent
2dae043e8f
commit
547e7c6a30
|
@ -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<ElementBuilder>) -> Self {
|
||||
pub fn push_child_opt(self, child: Option<impl IntoElement>) -> Self {
|
||||
if let Some(child) = child {
|
||||
self.push_child(child)
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue