Use closures for Svg::style

This commit is contained in:
Héctor Ramón Jiménez 2024-03-12 13:41:14 +01:00
parent 66dce4865e
commit 71b9b3c3b1
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 31 additions and 25 deletions

View file

@ -362,9 +362,11 @@ pub fn image<Handle>(handle: impl Into<Handle>) -> crate::Image<Handle> {
/// [`Svg`]: crate::Svg
/// [`Handle`]: crate::svg::Handle
#[cfg(feature = "svg")]
pub fn svg<Theme>(handle: impl Into<core::svg::Handle>) -> crate::Svg<Theme>
pub fn svg<'a, Theme>(
handle: impl Into<core::svg::Handle>,
) -> crate::Svg<'a, Theme>
where
Theme: crate::svg::DefaultStyle,
Theme: crate::svg::DefaultStyle + 'a,
{
crate::Svg::new(handle)
}