mirror of
https://github.com/servo/servo.git
synced 2025-08-15 10:25:32 +01:00
Auto merge of #17402 - servo:derive-all-the-things, r=emilio
Use generics for the filter property <!-- 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/17402) <!-- Reviewable:end -->
This commit is contained in:
commit
fc2c5b7ef4
21 changed files with 822 additions and 496 deletions
|
@ -41,7 +41,10 @@ macro_rules! no_viewport_percentage {
|
|||
|
||||
no_viewport_percentage!(bool, f32);
|
||||
|
||||
impl<T: HasViewportPercentage> HasViewportPercentage for Box<T> {
|
||||
impl<T> HasViewportPercentage for Box<T>
|
||||
where
|
||||
T: ?Sized + HasViewportPercentage
|
||||
{
|
||||
#[inline]
|
||||
fn has_viewport_percentage(&self) -> bool {
|
||||
(**self).has_viewport_percentage()
|
||||
|
@ -69,6 +72,13 @@ impl<T: HasViewportPercentage> HasViewportPercentage for Vec<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: HasViewportPercentage> HasViewportPercentage for [T] {
|
||||
#[inline]
|
||||
fn has_viewport_percentage(&self) -> bool {
|
||||
self.iter().any(T::has_viewport_percentage)
|
||||
}
|
||||
}
|
||||
|
||||
/// A set of viewport descriptors:
|
||||
///
|
||||
/// https://drafts.csswg.org/css-device-adapt/#viewport-desc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue