mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #18239 - servo:derive-all-the-things, r=emilio
Refactor how we handle trait bounds in style_derive <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18239) <!-- Reviewable:end -->
This commit is contained in:
commit
a266e96d28
27 changed files with 673 additions and 868 deletions
|
@ -199,6 +199,11 @@ impl<'a, 'cx, 'cx_a: 'cx, S: ToComputedValue + 'a> Iterator for ComputedVecIter<
|
|||
}
|
||||
|
||||
/// A trait to represent the conversion between computed and specified values.
|
||||
///
|
||||
/// This trait is derivable with `#[derive(ToComputedValue)]`. The derived
|
||||
/// implementation just calls `ToComputedValue::to_computed_value` on each field
|
||||
/// of the passed value, or `Clone::clone` if the field is annotated with
|
||||
/// `#[compute(clone)]`.
|
||||
pub trait ToComputedValue {
|
||||
/// The computed value type we're going to be converted to.
|
||||
type ComputedValue;
|
||||
|
@ -327,6 +332,7 @@ impl<T> ToComputedValue for T
|
|||
|
||||
impl ComputedValueAsSpecified for Atom {}
|
||||
impl ComputedValueAsSpecified for bool {}
|
||||
impl ComputedValueAsSpecified for f32 {}
|
||||
|
||||
impl ComputedValueAsSpecified for specified::BorderStyle {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue