mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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
|
@ -50,6 +50,7 @@ use script::dom::htmlelement::HTMLElementTypeId;
|
|||
use script::dom::htmlobjectelement::is_image_data;
|
||||
use script::dom::node::NodeTypeId;
|
||||
use servo_util::opts;
|
||||
use std::borrow::ToOwned;
|
||||
use std::collections::DList;
|
||||
use std::mem;
|
||||
use std::sync::atomic::Relaxed;
|
||||
|
@ -455,7 +456,7 @@ impl<'a> FlowConstructor<'a> {
|
|||
// Add whitespace results. They will be stripped out later on when
|
||||
// between block elements, and retained when between inline elements.
|
||||
let fragment_info =
|
||||
SpecificFragmentInfo::UnscannedText(UnscannedTextFragmentInfo::from_text(" ".into_string()));
|
||||
SpecificFragmentInfo::UnscannedText(UnscannedTextFragmentInfo::from_text(" ".to_owned()));
|
||||
let fragment = Fragment::from_opaque_node_and_style(whitespace_node,
|
||||
whitespace_style,
|
||||
whitespace_damage,
|
||||
|
@ -652,7 +653,7 @@ impl<'a> FlowConstructor<'a> {
|
|||
whitespace_damage)) => {
|
||||
// Instantiate the whitespace fragment.
|
||||
let fragment_info = SpecificFragmentInfo::UnscannedText(UnscannedTextFragmentInfo::from_text(
|
||||
" ".into_string()));
|
||||
" ".to_owned()));
|
||||
let fragment = Fragment::from_opaque_node_and_style(whitespace_node,
|
||||
whitespace_style,
|
||||
whitespace_damage,
|
||||
|
@ -986,7 +987,7 @@ impl<'a> FlowConstructor<'a> {
|
|||
.list_style_type) {
|
||||
None => None,
|
||||
Some(text) => {
|
||||
let text = text.into_string();
|
||||
let text = text.to_owned();
|
||||
let mut unscanned_marker_fragments = DList::new();
|
||||
unscanned_marker_fragments.push_back(Fragment::new_from_specific_info(
|
||||
node,
|
||||
|
|
|
@ -14,6 +14,7 @@ use servo_util::bloom::BloomFilter;
|
|||
use servo_util::cache::{Cache, LRUCache, SimpleHashCache};
|
||||
use servo_util::smallvec::{SmallVec, SmallVec16};
|
||||
use servo_util::arc_ptr_eq;
|
||||
use std::borrow::ToOwned;
|
||||
use std::mem;
|
||||
use std::hash::{Hash, sip};
|
||||
use std::slice::Items;
|
||||
|
@ -237,7 +238,7 @@ impl StyleSharingCandidate {
|
|||
parent_style: parent_style,
|
||||
local_name: element.get_local_name().clone(),
|
||||
class: element.get_attr(&ns!(""), &atom!("class"))
|
||||
.map(|string| string.into_string()),
|
||||
.map(|string| string.to_owned()),
|
||||
link: element.get_link().is_some(),
|
||||
namespace: (*element.get_namespace()).clone(),
|
||||
common_style_affecting_attributes:
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
use flow_ref::FlowRef;
|
||||
use flow;
|
||||
use serialize::json;
|
||||
|
||||
use std::borrow::ToOwned;
|
||||
use std::cell::RefCell;
|
||||
use std::io::File;
|
||||
use std::sync::atomic::{AtomicUint, SeqCst, INIT_ATOMIC_UINT};
|
||||
|
@ -105,7 +107,7 @@ pub fn begin_trace(flow_root: FlowRef) {
|
|||
STATE_KEY.with(|ref r| {
|
||||
let flow_trace = json::encode(&flow::base(flow_root.deref()));
|
||||
let state = State {
|
||||
scope_stack: vec![box ScopeData::new("root".into_string(), flow_trace)],
|
||||
scope_stack: vec![box ScopeData::new("root".to_owned(), flow_trace)],
|
||||
flow_root: flow_root.clone(),
|
||||
};
|
||||
*r.borrow_mut() = Some(state);
|
||||
|
|
|
@ -59,6 +59,7 @@ use servo_util::task_state;
|
|||
use servo_util::time::{TimeProfilerCategory, ProfilerMetadata, TimeProfilerChan};
|
||||
use servo_util::time::{TimerMetadataFrameType, TimerMetadataReflowType, profile};
|
||||
use servo_util::workqueue::WorkQueue;
|
||||
use std::borrow::ToOwned;
|
||||
use std::cell::Cell;
|
||||
use std::comm::{channel, Sender, Receiver, Select};
|
||||
use std::mem;
|
||||
|
@ -499,7 +500,7 @@ impl LayoutTask {
|
|||
// GWTODO: Need to handle unloading web fonts (when we handle unloading stylesheets!)
|
||||
let mut rw_data = self.lock_rw_data(possibly_locked_rw_data);
|
||||
iter_font_face_rules(&sheet, &rw_data.stylist.device, |family, src| {
|
||||
self.font_cache_task.add_web_font(family.into_string(), (*src).clone());
|
||||
self.font_cache_task.add_web_font(family.to_owned(), (*src).clone());
|
||||
});
|
||||
rw_data.stylist.add_stylesheet(sheet);
|
||||
LayoutTask::return_rw_data(possibly_locked_rw_data, rw_data);
|
||||
|
|
|
@ -67,6 +67,7 @@ use style::{LengthAttribute, PropertyDeclarationBlock, SimpleColorAttribute};
|
|||
use style::{TElement, TElementAttributes, TNode, UnsignedIntegerAttribute};
|
||||
use url::Url;
|
||||
|
||||
use std::borrow::ToOwned;
|
||||
use std::cell::{Ref, RefMut};
|
||||
|
||||
/// Allows some convenience methods on generic layout nodes.
|
||||
|
@ -212,7 +213,7 @@ impl<'ln> TLayoutNode for LayoutNode<'ln> {
|
|||
fn text(&self) -> String {
|
||||
unsafe {
|
||||
if let Some(text) = TextCast::to_js(self.get_jsmanaged()) {
|
||||
(*text.unsafe_get()).characterdata().data_for_layout().into_string()
|
||||
(*text.unsafe_get()).characterdata().data_for_layout().to_owned()
|
||||
} else if let Some(input) = HTMLInputElementCast::to_js(self.get_jsmanaged()) {
|
||||
input.get_value_for_layout()
|
||||
} else if let Some(area) = HTMLTextAreaElementCast::to_js(self.get_jsmanaged()) {
|
||||
|
@ -652,10 +653,10 @@ fn get_content(content_list: &content::T) -> String {
|
|||
let iter = &mut value.clone().into_iter().peekable();
|
||||
match iter.next() {
|
||||
Some(content::ContentItem::StringContent(content)) => content,
|
||||
_ => "".into_string(),
|
||||
_ => "".to_owned(),
|
||||
}
|
||||
}
|
||||
_ => "".into_string(),
|
||||
_ => "".to_owned(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue