layout: to_string() -> into_string()

This commit is contained in:
Manish Goregaokar 2014-12-14 04:19:29 +05:30 committed by Ms2ger
parent e9d1740e19
commit c7dfb1d24b
5 changed files with 9 additions and 9 deletions

View file

@ -451,7 +451,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(" ".to_string()));
SpecificFragmentInfo::UnscannedText(UnscannedTextFragmentInfo::from_text(" ".into_string()));
let fragment = Fragment::from_opaque_node_and_style(whitespace_node,
whitespace_style,
whitespace_damage,
@ -648,7 +648,7 @@ impl<'a> FlowConstructor<'a> {
whitespace_damage)) => {
// Instantiate the whitespace fragment.
let fragment_info = SpecificFragmentInfo::UnscannedText(UnscannedTextFragmentInfo::from_text(
" ".to_string()));
" ".into_string()));
let fragment = Fragment::from_opaque_node_and_style(whitespace_node,
whitespace_style,
whitespace_damage,
@ -959,7 +959,7 @@ impl<'a> FlowConstructor<'a> {
.list_style_type) {
None => None,
Some(text) => {
let text = text.to_string();
let text = text.into_string();
let mut unscanned_marker_fragments = DList::new();
unscanned_marker_fragments.push_back(Fragment::new_from_specific_info(
node,

View file

@ -241,7 +241,7 @@ impl StyleSharingCandidate {
parent_style: parent_style,
local_name: element.get_local_name().clone(),
class: element.get_attr(&ns!(""), &atom!("class"))
.map(|string| string.to_string()),
.map(|string| string.into_string()),
link: element.get_link().is_some(),
namespace: (*element.get_namespace()).clone(),
common_style_affecting_attributes:

View file

@ -104,7 +104,7 @@ pub fn begin_trace(flow_root: FlowRef) {
let flow_trace = json::encode(&flow::base(flow_root.deref()));
let state = State {
scope_stack: vec![box ScopeData::new("root".to_string(), flow_trace)],
scope_stack: vec![box ScopeData::new("root".into_string(), flow_trace)],
flow_root: flow_root,
};
state_key.replace(Some(RefCell::new(state)));

View file

@ -493,7 +493,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.to_string(), (*src).clone());
self.font_cache_task.add_web_font(family.into_string(), (*src).clone());
});
rw_data.stylist.add_stylesheet(sheet);
LayoutTask::return_rw_data(possibly_locked_rw_data, rw_data);

View file

@ -187,7 +187,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().to_string()
(*text.unsafe_get()).characterdata().data_for_layout().into_string()
} 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()) {
@ -634,10 +634,10 @@ fn get_content(content_list: &content::T) -> String {
let iter = &mut value.clone().into_iter().peekable();
match iter.next() {
Some(content::StringContent(content)) => content,
_ => "".to_string(),
_ => "".into_string(),
}
}
_ => "".to_string(),
_ => "".into_string(),
}
}