diff options
Diffstat (limited to 'components/layout/model.rs')
-rw-r--r-- | components/layout/model.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/components/layout/model.rs b/components/layout/model.rs index 02cae69fa21..9d0d4c69926 100644 --- a/components/layout/model.rs +++ b/components/layout/model.rs @@ -425,6 +425,14 @@ impl MaybeAuto { } #[inline] + pub fn to_option(&self) -> Option<Au> { + match *self { + MaybeAuto::Specified(value) => Some(value), + MaybeAuto::Auto => None, + } + } + + #[inline] pub fn specified_or_default(&self, default: Au) -> Au { match *self { MaybeAuto::Auto => default, |