Compute content sizes lazily in layout 2020

This commit is contained in:
Anthony Ramine 2020-06-18 14:11:02 +02:00
parent ba5568a0a6
commit 235df94f2e
11 changed files with 176 additions and 247 deletions

View file

@ -75,7 +75,7 @@ where
{
/// Resolves `auto` values by calling `f`.
#[inline]
pub fn auto_is(&self, f: impl Fn() -> LengthPercentage) -> LengthPercentage {
pub fn auto_is(&self, f: impl FnOnce() -> LengthPercentage) -> LengthPercentage {
match self {
LengthPercentageOrAuto::LengthPercentage(length) => length.clone(),
LengthPercentageOrAuto::Auto => f(),