Implement From<Option<T>> for Element

This commit is contained in:
Héctor Ramón Jiménez 2025-07-18 03:53:59 +02:00
parent dcea10f707
commit e0d9078334
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
9 changed files with 110 additions and 74 deletions

View file

@ -57,6 +57,7 @@ impl Length {
/// Adapts the [`Length`] so it can contain the other [`Length`] and
/// match its fluidity.
#[inline]
pub fn enclose(self, other: Length) -> Self {
match (self, other) {
(Length::Shrink, Length::Fill | Length::FillPortion(_)) => other,