mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +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
|
@ -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