diff options
Diffstat (limited to 'library/src/layout/stack.rs')
| -rw-r--r-- | library/src/layout/stack.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/library/src/layout/stack.rs b/library/src/layout/stack.rs index 2ce2cc28..f8670026 100644 --- a/library/src/layout/stack.rs +++ b/library/src/layout/stack.rs @@ -90,19 +90,16 @@ impl Debug for StackChild { } } -cast_from_value! { +cast! { StackChild, + self => match self { + Self::Spacing(spacing) => spacing.into_value(), + Self::Block(content) => content.into_value(), + }, v: Spacing => Self::Spacing(v), v: Content => Self::Block(v), } -cast_to_value! { - v: StackChild => match v { - StackChild::Spacing(spacing) => spacing.into(), - StackChild::Block(content) => content.into(), - } -} - /// Performs stack layout. struct StackLayouter<'a> { /// The stacking direction. |
