Remove redundant .clone()s

This commit is contained in:
Shotaro Yamada 2018-12-11 10:43:51 +09:00
parent eeaca0b26d
commit c44a2febe6
19 changed files with 31 additions and 35 deletions

View file

@ -405,7 +405,7 @@ impl FontCache {
match (template.bytes_if_in_memory(), template.native_font()) {
(Some(bytes), _) => txn.add_raw_font(font_key, bytes, 0),
(None, Some(native_font)) => txn.add_native_font(font_key, native_font),
(None, None) => txn.add_raw_font(font_key, template.bytes().clone(), 0),
(None, None) => txn.add_raw_font(font_key, template.bytes(), 0),
}
webrender_api.update_resources(txn.resource_updates);
font_key

View file

@ -195,7 +195,7 @@ impl<S: FontSource> FontContext<S> {
.get_font_instance(info.font_key, actual_pt_size);
Ok(Font::new(
handle,
descriptor.to_owned(),
descriptor,
actual_pt_size,
font_instance_key,
))

View file

@ -143,7 +143,7 @@ impl FontHandleMethods for FontHandle {
let mut handle = FontHandle {
face: face,
font_data: template.clone(),
font_data: template,
handle: fctx.clone(),
can_do_fast_shaping: false,
};