Use closures for Rule::style

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

View file

@ -315,9 +315,9 @@ pub fn vertical_space() -> Space {
/// Creates a horizontal [`Rule`] with the given height.
///
/// [`Rule`]: crate::Rule
pub fn horizontal_rule<Theme>(height: impl Into<Pixels>) -> Rule<Theme>
pub fn horizontal_rule<'a, Theme>(height: impl Into<Pixels>) -> Rule<'a, Theme>
where
Theme: rule::DefaultStyle,
Theme: rule::DefaultStyle + 'a,
{
Rule::horizontal(height)
}
@ -325,9 +325,9 @@ where
/// Creates a vertical [`Rule`] with the given width.
///
/// [`Rule`]: crate::Rule
pub fn vertical_rule<Theme>(width: impl Into<Pixels>) -> Rule<Theme>
pub fn vertical_rule<'a, Theme>(width: impl Into<Pixels>) -> Rule<'a, Theme>
where
Theme: rule::DefaultStyle,
Theme: rule::DefaultStyle + 'a,
{
Rule::vertical(width)
}