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
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue