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
|
@ -3,6 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use geom::{Point2D, Rect, Size2D};
|
||||
use std::borrow::ToOwned;
|
||||
use std::mem;
|
||||
use std::slice;
|
||||
use std::rc::Rc;
|
||||
|
@ -162,7 +163,7 @@ impl Font {
|
|||
|
||||
let glyphs = Arc::new(glyphs);
|
||||
self.shape_cache.insert(ShapeCacheEntry {
|
||||
text: text.into_string(),
|
||||
text: text.to_owned(),
|
||||
options: *options,
|
||||
}, glyphs.clone());
|
||||
glyphs
|
||||
|
|
|
@ -17,6 +17,7 @@ use servo_util::smallvec::{SmallVec, SmallVec8};
|
|||
use servo_util::geometry::Au;
|
||||
use servo_util::arc_ptr_eq;
|
||||
|
||||
use std::borrow::ToOwned;
|
||||
use std::rc::Rc;
|
||||
use std::cell::RefCell;
|
||||
use std::sync::Arc;
|
||||
|
@ -168,7 +169,7 @@ impl FontContext {
|
|||
|
||||
if !cache_hit {
|
||||
let font_template = self.font_cache_task.get_font_template(family.name()
|
||||
.into_string(),
|
||||
.to_owned(),
|
||||
desc.clone());
|
||||
match font_template {
|
||||
Some(font_template) => {
|
||||
|
@ -178,14 +179,14 @@ impl FontContext {
|
|||
style.font_variant);
|
||||
let layout_font = Rc::new(RefCell::new(layout_font));
|
||||
self.layout_font_cache.push(LayoutFontCacheEntry {
|
||||
family: family.name().into_string(),
|
||||
family: family.name().to_owned(),
|
||||
font: Some(layout_font.clone()),
|
||||
});
|
||||
fonts.push(layout_font);
|
||||
}
|
||||
None => {
|
||||
self.layout_font_cache.push(LayoutFontCacheEntry {
|
||||
family: family.name().into_string(),
|
||||
family: family.name().to_owned(),
|
||||
font: None,
|
||||
});
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ use platform::font_context::FontContextHandle;
|
|||
use platform::font::FontHandle;
|
||||
use platform::font_template::FontTemplateData;
|
||||
|
||||
use std::borrow::ToOwned;
|
||||
use std::sync::{Arc, Weak};
|
||||
use font::FontHandleMethods;
|
||||
|
||||
|
@ -68,7 +69,7 @@ impl FontTemplate {
|
|||
};
|
||||
|
||||
FontTemplate {
|
||||
identifier: identifier.into_string(),
|
||||
identifier: identifier.to_owned(),
|
||||
descriptor: None,
|
||||
weak_ref: maybe_weak_ref,
|
||||
strong_ref: maybe_strong_ref,
|
||||
|
|
|
@ -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