mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Remove some as_slice calls.
This commit is contained in:
parent
4ee89363fb
commit
6a55ae06d7
34 changed files with 79 additions and 79 deletions
|
@ -24,7 +24,7 @@ pub fn get_variations_for_family<F>(family_name: &str, mut callback: F) where F:
|
|||
debug!("Looking for faces of family: {}", family_name);
|
||||
|
||||
let family_collection =
|
||||
core_text::font_collection::create_for_family(family_name.as_slice());
|
||||
core_text::font_collection::create_for_family(family_name);
|
||||
match family_collection {
|
||||
Some(family_collection) => {
|
||||
let family_descriptors = family_collection.get_descriptors();
|
||||
|
|
|
@ -26,7 +26,7 @@ impl FontTemplateData {
|
|||
pub fn new(identifier: &str, font_data: Option<Vec<u8>>) -> FontTemplateData {
|
||||
let ctfont = match font_data {
|
||||
Some(ref bytes) => {
|
||||
let fontprov = CGDataProvider::from_buffer(bytes.as_slice());
|
||||
let fontprov = CGDataProvider::from_buffer(bytes);
|
||||
let cgfont_result = CGFont::from_data_provider(fontprov);
|
||||
match cgfont_result {
|
||||
Ok(cgfont) => Some(core_text::font::new_from_CGFont(&cgfont, 0.0)),
|
||||
|
@ -34,7 +34,7 @@ impl FontTemplateData {
|
|||
}
|
||||
},
|
||||
None => {
|
||||
Some(core_text::font::new_from_name(identifier.as_slice(), 0.0).unwrap())
|
||||
Some(core_text::font::new_from_name(&identifier, 0.0).unwrap())
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue