From 1bbdcb19112b5c23616894b6ce20b950167be5b9 Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Fri, 13 Jun 2025 10:29:37 +0200 Subject: [PATCH] layout: Avoid useless LazyCell when resolving replaced element's size (#37419) The callback can be used instead, since `Size::resolve()` already takes care of creating a `LazyCell`. Testing: Unnecessary, no behavior change Signed-off-by: Oriol Brufau --- components/layout/replaced.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/layout/replaced.rs b/components/layout/replaced.rs index 6f3535ca6d5..9ae886bf0ed 100644 --- a/components/layout/replaced.rs +++ b/components/layout/replaced.rs @@ -536,7 +536,7 @@ impl ReplacedContents { ); // Now we can compute the block size, using the inline size from above. - let block_content_size = LazyCell::new(|| -> ContentSizes { + let get_block_content_size = || -> ContentSizes { let get_inline_size = || SizeConstraint::Definite(inline_size); self.content_size( Direction::Block, @@ -545,13 +545,13 @@ impl ReplacedContents { &get_block_fallback_size, ) .into() - }); + }; let block_size = sizes.block.resolve( Direction::Block, automatic_size.block, Au::zero, block_stretch_size, - || *block_content_size, + get_block_content_size, false, /* is_table */ );