mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Improve handling of trait bounds when deriving fmap-like traits
This commit is contained in:
parent
8101887d31
commit
efc852f6e3
12 changed files with 229 additions and 136 deletions
|
@ -354,27 +354,3 @@ impl HasViewportPercentage for GridTemplateComponent<LengthOrPercentage> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ToComputedValue for GridTemplateComponent<LengthOrPercentage> {
|
||||
type ComputedValue = GridTemplateComponent<computed::LengthOrPercentage>;
|
||||
|
||||
#[inline]
|
||||
fn to_computed_value(&self, context: &Context) -> Self::ComputedValue {
|
||||
match *self {
|
||||
GridTemplateComponent::None => GridTemplateComponent::None,
|
||||
GridTemplateComponent::TrackList(ref l) => GridTemplateComponent::TrackList(l.to_computed_value(context)),
|
||||
GridTemplateComponent::Subgrid(ref n) => GridTemplateComponent::Subgrid(n.to_computed_value(context)),
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn from_computed_value(computed: &Self::ComputedValue) -> Self {
|
||||
match *computed {
|
||||
GridTemplateComponent::None => GridTemplateComponent::None,
|
||||
GridTemplateComponent::TrackList(ref l) =>
|
||||
GridTemplateComponent::TrackList(ToComputedValue::from_computed_value(l)),
|
||||
GridTemplateComponent::Subgrid(ref n) =>
|
||||
GridTemplateComponent::Subgrid(ToComputedValue::from_computed_value(n)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue