mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #19985 - servo:derive-these-things-too, r=emilio
Derive ComputeSquaredDistance for animated filters <!-- 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/19985) <!-- Reviewable:end -->
This commit is contained in:
commit
c22baf58d0
3 changed files with 16 additions and 20 deletions
|
@ -16,6 +16,7 @@ use selectors::parser::SelectorParseErrorKind;
|
|||
use std::fmt::{self, Debug, Write};
|
||||
use std::hash;
|
||||
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
|
||||
use values::distance::{ComputeSquaredDistance, SquaredDistance};
|
||||
|
||||
pub mod animated;
|
||||
pub mod computed;
|
||||
|
@ -66,6 +67,18 @@ where
|
|||
#[derive(Clone, Copy, Debug, PartialEq, ToComputedValue, ToCss)]
|
||||
pub enum Impossible {}
|
||||
|
||||
// FIXME(nox): This should be derived but the derive code cannot cope
|
||||
// with uninhabited enums.
|
||||
impl ComputeSquaredDistance for Impossible {
|
||||
#[inline]
|
||||
fn compute_squared_distance(
|
||||
&self,
|
||||
_other: &Self,
|
||||
) -> Result<SquaredDistance, ()> {
|
||||
match *self {}
|
||||
}
|
||||
}
|
||||
|
||||
impl Parse for Impossible {
|
||||
fn parse<'i, 't>(
|
||||
_context: &ParserContext,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue