mirror of
https://github.com/servo/servo.git
synced 2025-08-16 02:45:36 +01:00
clippy: Fix remaining warnings in gfx
for MacOS (#31669)
This commit is contained in:
parent
cb3ae70340
commit
a8791ddcbc
9 changed files with 66 additions and 69 deletions
|
@ -181,16 +181,15 @@ impl FontTemplate {
|
|||
})
|
||||
}
|
||||
|
||||
fn instantiate(&mut self, font_context: &FontContextHandle) -> Result<(), ()> {
|
||||
fn instantiate(&mut self, font_context: &FontContextHandle) -> Result<(), &'static str> {
|
||||
if !self.is_valid {
|
||||
return Err(());
|
||||
return Err("Invalid font template");
|
||||
}
|
||||
|
||||
let data = self.data().map_err(|_| ())?;
|
||||
let handle: Result<FontHandle, ()> =
|
||||
FontHandleMethods::new_from_template(font_context, data, None);
|
||||
let data = self.data().map_err(|_| "Could not get FontTemplate data")?;
|
||||
let handle = FontHandleMethods::new_from_template(font_context, data, None);
|
||||
self.is_valid = handle.is_ok();
|
||||
let handle = handle?;
|
||||
let handle: FontHandle = handle?;
|
||||
self.descriptor = Some(FontTemplateDescriptor::new(
|
||||
handle.boldness(),
|
||||
handle.stretchiness(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue