mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Move to to_owned rather than into_string.
into_string has been removed from Rust.
This commit is contained in:
parent
2d5b0e0855
commit
01ed338746
67 changed files with 473 additions and 383 deletions
|
@ -22,6 +22,7 @@ use fontconfig::fontconfig::{
|
|||
|
||||
use libc;
|
||||
use libc::c_int;
|
||||
use std::borrow::ToOwned;
|
||||
use std::ptr;
|
||||
use std::string::String;
|
||||
|
||||
|
@ -127,13 +128,13 @@ pub fn get_system_default_family(generic_name: &str) -> Option<String> {
|
|||
#[cfg(target_os="linux")]
|
||||
pub fn get_last_resort_font_families() -> Vec<String> {
|
||||
vec!(
|
||||
"Fira Sans".into_string(),
|
||||
"DejaVu Sans".into_string(),
|
||||
"Arial".into_string()
|
||||
"Fira Sans".to_owned(),
|
||||
"DejaVu Sans".to_owned(),
|
||||
"Arial".to_owned()
|
||||
)
|
||||
}
|
||||
|
||||
#[cfg(target_os="android")]
|
||||
pub fn get_last_resort_font_families() -> Vec<String> {
|
||||
vec!("Roboto".into_string())
|
||||
vec!("Roboto".to_owned())
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use std::borrow::ToOwned;
|
||||
use std::io;
|
||||
use std::io::File;
|
||||
|
||||
|
@ -29,7 +30,7 @@ impl FontTemplateData {
|
|||
|
||||
FontTemplateData {
|
||||
bytes: bytes,
|
||||
identifier: identifier.into_string(),
|
||||
identifier: identifier.to_owned(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ use core_foundation::base::TCFType;
|
|||
use core_foundation::string::{CFString, CFStringRef};
|
||||
use core_text::font_descriptor::{CTFontDescriptor, CTFontDescriptorRef};
|
||||
use core_text;
|
||||
|
||||
use std::borrow::ToOwned;
|
||||
use std::mem;
|
||||
|
||||
pub fn get_available_families(callback: |String|) {
|
||||
|
@ -42,5 +44,5 @@ pub fn get_system_default_family(_generic_name: &str) -> Option<String> {
|
|||
}
|
||||
|
||||
pub fn get_last_resort_font_families() -> Vec<String> {
|
||||
vec!("Arial Unicode MS".into_string(), "Arial".into_string())
|
||||
vec!("Arial Unicode MS".to_owned(), "Arial".to_owned())
|
||||
}
|
||||
|
|
|
@ -7,6 +7,8 @@ use core_graphics::font::CGFont;
|
|||
use core_text::font::CTFont;
|
||||
use core_text;
|
||||
|
||||
use std::borrow::ToOwned;
|
||||
|
||||
/// Platform specific font representation for mac.
|
||||
/// The identifier is a PostScript font name. The
|
||||
/// CTFont object is cached here for use by the
|
||||
|
@ -34,7 +36,7 @@ impl FontTemplateData {
|
|||
|
||||
FontTemplateData {
|
||||
ctfont: ctfont,
|
||||
identifier: identifier.into_string(),
|
||||
identifier: identifier.to_owned(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue