Move to to_owned rather than into_string.

into_string has been removed from Rust.
This commit is contained in:
Ms2ger 2015-01-20 14:45:36 +01:00
parent 2d5b0e0855
commit 01ed338746
67 changed files with 473 additions and 383 deletions

View file

@ -5,6 +5,8 @@
use servo_util::str::DOMString;
use url::Url;
use std::borrow::ToOwned;
pub struct UrlHelper;
impl UrlHelper {
@ -14,16 +16,16 @@ impl UrlHelper {
pub fn Search(url: &Url) -> DOMString {
match url.query {
None => "".into_string(),
Some(ref query) if query.as_slice() == "" => "".into_string(),
None => "".to_owned(),
Some(ref query) if query.as_slice() == "" => "".to_owned(),
Some(ref query) => format!("?{}", query)
}
}
pub fn Hash(url: &Url) -> DOMString {
match url.fragment {
None => "".into_string(),
Some(ref hash) if hash.as_slice() == "" => "".into_string(),
None => "".to_owned(),
Some(ref hash) if hash.as_slice() == "" => "".to_owned(),
Some(ref hash) => format!("#{}", hash)
}
}