aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <release+servo@mozilla.com>2014-05-12 14:55:22 -0400
committerbors-servo <release+servo@mozilla.com>2014-05-12 14:55:22 -0400
commit3bb81310d4051c80cb9eec04a8382c95159de970 (patch)
treec6582e68c066a79714207ead8d9d968ed2720579
parentc6274f9793cf3bab74b58a697961680567dea97b (diff)
parent85ce33916cb105d8e82ef8011061ede37f54998a (diff)
downloadservo-3bb81310d4051c80cb9eec04a8382c95159de970.tar.gz
servo-3bb81310d4051c80cb9eec04a8382c95159de970.zip
auto merge of #2407 : Ms2ger/servo/try_parse_url-owned, r=jdm
-rw-r--r--src/components/util/url.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/util/url.rs b/src/components/util/url.rs
index 47c4043b330..da2ca64c0e0 100644
--- a/src/components/util/url.rs
+++ b/src/components/util/url.rs
@@ -18,7 +18,7 @@ Create a URL object from a string. Does various helpful browsery things like
*/
// TODO: about:failure->
pub fn try_parse_url(str_url: &str, base_url: Option<std_url::Url>) -> Result<std_url::Url, ~str> {
- let str_url = str_url.trim_chars(& &[' ', '\t', '\n', '\r', '\x0C']).to_owned();
+ let str_url = str_url.trim_chars(& &[' ', '\t', '\n', '\r', '\x0C']);
let schm = std_url::get_scheme(str_url);
let str_url = match schm {
Err(_) => {
@@ -69,7 +69,7 @@ pub fn try_parse_url(str_url: &str, base_url: Option<std_url::Url>) -> Result<st
"file://".to_owned() + path.display().to_str()
}
// TODO: handle the rest of the about: pages
- _ => str_url
+ _ => str_url.to_owned()
}
},
"data" => {
@@ -78,7 +78,7 @@ pub fn try_parse_url(str_url: &str, base_url: Option<std_url::Url>) -> Result<st
// %-encoded or base64'd.
str_url.chars().filter(|&c| !c.is_whitespace()).collect()
},
- _ => str_url
+ _ => str_url.to_owned()
}
}
};