aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/urlhelper.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/urlhelper.rs')
-rw-r--r--components/script/dom/urlhelper.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/components/script/dom/urlhelper.rs b/components/script/dom/urlhelper.rs
index 8f3a005127d..290fede857c 100644
--- a/components/script/dom/urlhelper.rs
+++ b/components/script/dom/urlhelper.rs
@@ -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)
}
}