aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flexbox/geom.rs
diff options
context:
space:
mode:
authorOriol Brufau <obrufau@igalia.com>2025-03-14 22:37:19 +0100
committerGitHub <noreply@github.com>2025-03-14 21:37:19 +0000
commit7517976722be3b7b24574d22a29080993c69299c (patch)
treea3835e77f875d347d274f2ad3800f1b298f3fb25 /components/layout_2020/flexbox/geom.rs
parentf93d65b49653b626270a3c82b0ed257f4a303013 (diff)
downloadservo-7517976722be3b7b24574d22a29080993c69299c.tar.gz
servo-7517976722be3b7b24574d22a29080993c69299c.zip
layout: Unify `FlexItem::new()` and `FlexItemBox::main_content_size_info()` (#35900)
These methods were doing virtually the same thing. So this patch moves the common logic into a new `FlexItemBox::to_flex_item()`, which is then called by `FlexItem::new()` and `FlexItemBox::main_content_size_info()`. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Diffstat (limited to 'components/layout_2020/flexbox/geom.rs')
-rw-r--r--components/layout_2020/flexbox/geom.rs9
1 files changed, 0 insertions, 9 deletions
diff --git a/components/layout_2020/flexbox/geom.rs b/components/layout_2020/flexbox/geom.rs
index 870abf3c751..6a302e27486 100644
--- a/components/layout_2020/flexbox/geom.rs
+++ b/components/layout_2020/flexbox/geom.rs
@@ -14,15 +14,6 @@ pub(super) struct FlexRelativeVec2<T> {
pub cross: T,
}
-impl<T> FlexRelativeVec2<T> {
- pub fn map<U>(&self, f: impl Fn(&T) -> U) -> FlexRelativeVec2<U> {
- FlexRelativeVec2 {
- main: f(&self.main),
- cross: f(&self.cross),
- }
- }
-}
-
#[derive(Clone, Copy, Debug)]
pub(super) struct FlexRelativeSides<T> {
pub cross_start: T,