Make PropertyDeclaration::id and AnimationValue::id inline

This commit is contained in:
Anthony Ramine 2018-02-09 23:58:33 +01:00
parent 921d1aeeba
commit 57daf06c71
2 changed files with 2 additions and 0 deletions

View file

@ -363,6 +363,7 @@ pub enum AnimationValue {
impl AnimationValue {
/// Returns the longhand id this animated value corresponds to.
#[inline]
pub fn id(&self) -> LonghandId {
let id = unsafe { *(self as *const _ as *const LonghandId) };
debug_assert_eq!(id, match *self {

View file

@ -1739,6 +1739,7 @@ impl fmt::Debug for PropertyDeclaration {
impl PropertyDeclaration {
/// Given a property declaration, return the property declaration id.
#[inline]
pub fn id(&self) -> PropertyDeclarationId {
match *self {
PropertyDeclaration::Custom(ref declaration) => {