Implement "outer min/max-content" (based on a given min/max-content)

https://dbaron.org/css/intrinsic/#outer-intrinsic
This commit is contained in:
Simon Sapin 2019-12-02 17:36:33 +01:00
parent aa925a5984
commit 8fe37f3ed6
3 changed files with 80 additions and 1 deletions

View file

@ -92,7 +92,7 @@ where
}
/// Maps the length of this value.
pub fn map(&self, f: impl FnOnce(LengthPercentage) -> LengthPercentage) -> Self {
pub fn map<T>(&self, f: impl FnOnce(LengthPercentage) -> T) -> LengthPercentageOrAuto<T> {
match self {
LengthPercentageOrAuto::LengthPercentage(l) => {
LengthPercentageOrAuto::LengthPercentage(f(l.clone()))