Derive PartialEq on the style Font structure

We check the hash first.
This commit is contained in:
Anthony Ramine 2015-10-08 00:32:58 +02:00
parent 217c7da413
commit 6d6dbf0129
2 changed files with 17 additions and 6 deletions

View file

@ -321,12 +321,7 @@ struct LayoutFontGroupCacheKey {
impl PartialEq for LayoutFontGroupCacheKey {
fn eq(&self, other: &LayoutFontGroupCacheKey) -> bool {
self.pointer.font_family == other.pointer.font_family &&
self.pointer.font_stretch == other.pointer.font_stretch &&
self.pointer.font_style == other.pointer.font_style &&
self.pointer.font_weight as u16 == other.pointer.font_weight as u16 &&
self.pointer.font_variant == other.pointer.font_variant &&
self.size == other.size
self.pointer == other.pointer && self.size == other.size
}
}