Try using closures for Container::style
`Box` should not allocate for zero-sized types; so we should not be incurring much overhead. Just a bit of indirection.
This commit is contained in:
parent
34317bba5d
commit
2088e5d661
5 changed files with 43 additions and 39 deletions
|
|
@ -58,7 +58,7 @@ pub fn container<'a, Message, Theme, Renderer>(
|
|||
content: impl Into<Element<'a, Message, Theme, Renderer>>,
|
||||
) -> Container<'a, Message, Theme, Renderer>
|
||||
where
|
||||
Theme: container::DefaultStyle,
|
||||
Theme: container::DefaultStyle + 'a,
|
||||
Renderer: core::Renderer,
|
||||
{
|
||||
Container::new(content)
|
||||
|
|
@ -134,7 +134,7 @@ pub fn tooltip<'a, Message, Theme, Renderer>(
|
|||
position: tooltip::Position,
|
||||
) -> crate::Tooltip<'a, Message, Theme, Renderer>
|
||||
where
|
||||
Theme: container::DefaultStyle,
|
||||
Theme: container::DefaultStyle + 'a,
|
||||
Renderer: core::text::Renderer,
|
||||
{
|
||||
Tooltip::new(content, tooltip, position)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue