Auto merge of #11229 - Ms2ger:create_layout_font, r=emilio

Simplify FontContext::create_layout_font.

Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data:
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy --faster` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

Either:
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because refactoring

Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11229)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-05-17 05:30:53 -07:00
commit 8bfeea5f20

View file

@ -118,12 +118,11 @@ impl FontContext {
font_variant::T::normal => pt_size,
};
let handle: Result<FontHandle, _> =
FontHandleMethods::new_from_template(&self.platform_handle, template,
Some(actual_pt_size));
let handle = try!(FontHandle::new_from_template(&self.platform_handle,
template,
Some(actual_pt_size)));
handle.map(|handle|
Font::new(handle, variant, descriptor, pt_size, actual_pt_size, font_key))
Ok(Font::new(handle, variant, descriptor, pt_size, actual_pt_size, font_key))
}
fn expire_font_caches_if_necessary(&mut self) {