gfx: Simplify OSX font template bytes accessor.

This commit is contained in:
Emilio Cobos Álvarez 2016-12-25 17:34:42 +01:00
parent 6264268c82
commit 39e082af18
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -81,9 +81,8 @@ impl FontTemplateData {
/// operation (depending on the platform) which performs synchronous disk I/O /// operation (depending on the platform) which performs synchronous disk I/O
/// and should never be done lightly. /// and should never be done lightly.
pub fn bytes(&self) -> Vec<u8> { pub fn bytes(&self) -> Vec<u8> {
match self.bytes_if_in_memory() { if let Some(font_data) = self.bytes_if_in_memory() {
Some(font_data) => return font_data, return font_data;
None => {}
} }
let path = ServoUrl::parse(&*self.ctfont(0.0) let path = ServoUrl::parse(&*self.ctfont(0.0)