Repository: bevyengine/bevy
File: crates/bevy_ui/src/layout/convert.rs (Rust)

Code before:
            ),
            MinTrackSizingFunction::Vh(val) => taffy::style::MinTrackSizingFunction::length(
                Val::Vh(val)
                    .into_length_percentage(context)
                    .into_raw()
                    .value(),
            ),
            MinTrackSizingFunction::Vw(val) => taffy::style::MinTrackSizingFunction::length(
                Val::Vw(val)
                    .into_length_percentage(context)
                    .into_raw()
                    .value(),
            ),
        }
    }
}

impl MaxTrackSizingFunction {
    fn into_taffy(self, context: &LayoutContext) -> taffy::style::MaxTrackSizingFunction {
        match self {
            MaxTrackSizingFunction::Px(val) => taffy::style::MaxTrackSizingFunction::length(
                Val::Px(val)
                    .into_length_percentage(context)
                    .into_raw()
                    .value(),
            ),
            MaxTrackSizingFunction::Percent(val) => taffy::style::MaxTrackSizingFunction::percent(
                Val::Percent(val)
                    .into_length_percentage(context)
                    .into_raw()
                    .value(),
            ),
            MaxTrackSizingFunction::Auto => taffy::style::MaxTrackSizingFunction::auto(),
            MaxTrackSizingFunction::MinContent => {
                taffy::style::MaxTrackSizingFunction::min_content()
            }
            MaxTrackSizingFunction::MaxContent => {
                taffy::style::MaxTrackSizingFunction::max_content()
            }
            MaxTrackSizingFunction::FitContentPx(val) => {
                taffy::style::MaxTrackSizingFunction::fit_content_px(
                    Val::Px(val)
                        .into_length_percentage(context)
                        .into_raw()
                        .value(),
                )
            }
            MaxTrackSizingFunction::FitContentPercent(val) => {
                taffy::style::MaxTrackSizingFunction::fit_content_percent(
                    Val::Percent(val)
                        .into_length_percentage(context)

Review comment (suggestion):
Same here:
```suggestion
                       MaxTrackSizingFunction::Px(val) => Val::Px(val).into_length_percentage(context).into(),
```

Code after:
            MaxTrackSizingFunction::Auto => taffy::style::MaxTrackSizingFunction::auto(),
            MaxTrackSizingFunction::MinContent => {
                taffy::style::MaxTrackSizingFunction::min_content()
            }
            MaxTrackSizingFunction::MaxContent => {
                taffy::style::MaxTrackSizingFunction::max_content()
            }
            MaxTrackSizingFunction::FitContentPx(val) => {
                taffy::style::MaxTrackSizingFunction::fit_content_px(
                    Val::Px(val)
                        .into_length_percentage(context)
                        .into_raw()
                        .value(),
                )
            }
            MaxTrackSizingFunction::FitContentPercent(val) => {
                taffy::style::MaxTrackSizingFunction::fit_content_percent(
                    Val::Percent(val)
                        .into_length_percentage(context)
                        .into_raw()
                        .value(),
                )
            }
            MaxTrackSizingFunction::Fraction(fraction) => {
                taffy::style::MaxTrackSizingFunction::fr(fraction)
            }
            MaxTrackSizingFunction::VMin(val) => {
                Val::VMin(val).into_length_percentage(context).into()
            }
            MaxTrackSizingFunction::VMax(val) => {
                Val::VMax(val).into_length_percentage(context).into()
            }
            MaxTrackSizingFunction::Vh(val) => Val::Vh(val).into_length_percentage(context).into(),
            MaxTrackSizingFunction::Vw(val) => Val::Vw(val).into_length_percentage(context).into(),
        }
    }
}

impl GridTrack {
    fn into_taffy_track(self, context: &LayoutContext) -> taffy::style::TrackSizingFunction {
        let min = self.min_sizing_function.into_taffy(context);
        let max = self.max_sizing_function.into_taffy(context);
        style_helpers::minmax(min, max)
    }
}

impl RepeatedGridTrack {
    fn clone_into_repeated_taffy_track(
        &self,
        context: &LayoutContext,
    ) -> taffy::style::GridTemplateComponent<String> {